Fix bad handling of child proc stderr
This commit is contained in:
parent
1f533d25fb
commit
7c50a17671
@ -18,11 +18,11 @@ module.exports.ChildProcessEmitter = class ChildProcessEmitter extends EventEmit
|
||||
this.childProcess = spawn(cmd, args);
|
||||
|
||||
this.childProcess.on('error', function(err) {
|
||||
logger.error("process error", { name: name, err: err });
|
||||
this.logger.error("process error", { class: this.constructor.name, name: name, err: String(err).trim() });
|
||||
});
|
||||
|
||||
this.childProcess.on('close', function(code, signal) {
|
||||
logger.debug("process closed", { name: name, code: code, signal: signal });
|
||||
this.logger.debug("process closed", { class: this.constructor.name, name: name, code: code, signal: signal });
|
||||
});
|
||||
|
||||
this.childProcess.stdout.on('data', (data) => {
|
||||
@ -33,7 +33,7 @@ module.exports.ChildProcessEmitter = class ChildProcessEmitter extends EventEmit
|
||||
});
|
||||
|
||||
this.childProcess.stderr.on('data', (data) => {
|
||||
this.emit('message', lines[i]);
|
||||
this.logger.error('process stderr', { class: this.constructor.name, stderr: String(data).trim()});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ const ChildProcessEmitter = require('./child-process').ChildProcessEmitter;
|
||||
|
||||
class MediaPlayer extends ChildProcessEmitter {
|
||||
constructor(config, logger) {
|
||||
super(config.mpg321);
|
||||
super(config.mpg321, logger);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ const ChildProcessEmitter = require('./child-process').ChildProcessEmitter;
|
||||
|
||||
class TagReader extends ChildProcessEmitter {
|
||||
constructor(config, logger) {
|
||||
super(config.tag_reader);
|
||||
super(config.tag_reader, logger);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user