mirror of
https://github.com/koush/scrypted.git
synced 2026-04-29 11:20:25 +01:00
server: aggressively catch child process pipe errors (#1609)
* server: aggressively catch python child process pipe errors * document error behavior * move stdio error handling to setupWorker * handle undefined stdio
This commit is contained in:
@@ -19,6 +19,12 @@ export abstract class ChildProcessWorker extends EventEmitter implements Runtime
|
||||
this.worker.on('disconnect', () => this.emit('error', new Error('disconnect')));
|
||||
this.worker.on('exit', (code, signal) => this.emit('exit', code, signal));
|
||||
this.worker.on('error', e => this.emit('error', e));
|
||||
// aggressively catch errors
|
||||
// ECONNRESET can be raised when the child process is killed
|
||||
for (const stdio of this.worker.stdio || []) {
|
||||
if (stdio)
|
||||
stdio.on('error', e => this.emit('error', e));
|
||||
}
|
||||
}
|
||||
|
||||
get pid() {
|
||||
|
||||
Reference in New Issue
Block a user