Fixed "TypeError: invalid data" when executables run by exec exited with non-zero code.

The original error was because process.stderr only allows writing Strings or Buffers, but status is a Number.

Also, the message parameter of the "error" handler is just the amalgam of all output written to stderr. This is already logged by the "stderr" handler, so there's no need to write it to process.stderr again.
This commit is contained in:
Arnavion
2014-12-16 02:45:17 -08:00
parent 1eba8db465
commit f042044fce

View File

@@ -447,8 +447,7 @@ function exec(cmd, completeHandler) {
complete();
});
ex.addListener("error", function(e, status) {
process.stderr.write(status);
process.stderr.write(e);
console.error("Process exited with code " + status);
complete();
})
try{