Permalink
Browse files

ENYO-1189: consolidate sub-processes exception path & report to parent

- When a sub-process fails, pile-on exceptions backtraces & report the
  sum to the caller process.  This way, the full error context is
  reported to the application developer.

Enyo-DCO-1.1-Signed-off-by: Francois-Xavier KOWALSKI <francois-xavier.kowalski@hp.com>
  • Loading branch information...
1 parent 7774855 commit 3013c722cb5907dee2f981784cabbe03108f67e6 @asnowfix asnowfix committed Nov 15, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 tools/deploy.js
View
@@ -47,10 +47,11 @@ var stat, ppwd, lib, script, scripts = {};
// Send message to parent node process, if any
process.on('uncaughtException', function (err) {
- console.error(err.stack);
+ var errMsg = err.toString() + err.stack;
+ console.error(errMsg);
if (process.send) {
// only available if parent process is node
- process.send({error: err.toString()});
+ process.send({error: errMsg});
}
process.exit(1);
});

0 comments on commit 3013c72

Please sign in to comment.