mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-09 20:36:32 +00:00
Better error handling when killing the BE process.
Catch the ESRCH error when terminating non-existing backend process. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
ec8df37c2d
commit
daa25794ef
@ -286,7 +286,15 @@ app.on('ready', () => {
|
|||||||
app.on('quit', () => {
|
app.on('quit', () => {
|
||||||
// If we forked the process for the clusters, we need to manually terminate it.
|
// If we forked the process for the clusters, we need to manually terminate it.
|
||||||
// See: https://github.com/eclipse-theia/theia/issues/835
|
// See: https://github.com/eclipse-theia/theia/issues/835
|
||||||
|
try {
|
||||||
process.kill(cp.pid);
|
process.kill(cp.pid);
|
||||||
|
} catch (e) {
|
||||||
|
if (e.code === 'ESRCH') {
|
||||||
|
console.log('Could not terminate the backend process. It was not running.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user