Skip to content

Commit fcb7371

Browse files
committed
chore: node spawn error handling
1 parent 1eac8b3 commit fcb7371

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/node-loader.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,20 @@ function nodeLoader() {
767767
}
768768
});
769769

770+
window.electronAppAPI.onProcessError((eventInstanceId, err) => {
771+
if (eventInstanceId !== instanceId) {
772+
return;
773+
}
774+
window.isNodeTerminated = true;
775+
window.isNodeReady = false;
776+
nodeTerminationResolve();
777+
console.error(`PhNode: command error: "${err.message}"`);
778+
if (!resolved) {
779+
logger.reportError(err, `PhNode failed to start!`);
780+
reject("PhNode: closed - Terminated.");
781+
}
782+
});
783+
770784
window.electronAppAPI.onProcessStdout((eventInstanceId, line) => {
771785
if (eventInstanceId !== instanceId) {
772786
return;

0 commit comments

Comments
 (0)