mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 20:06: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', () => {
|
||||
// If we forked the process for the clusters, we need to manually terminate it.
|
||||
// See: https://github.com/eclipse-theia/theia/issues/835
|
||||
process.kill(cp.pid);
|
||||
try {
|
||||
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