Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit

Permalink
fixes #399, combining errors in Node
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jun 22, 2015
1 parent 6c6a6a2 commit b97c6be
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/wrapper-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@
var newErr;
if (err instanceof Error) {
var newErr = new Error(err.message, err.fileName, err.lineNumber);
newErr.message = err.message + '\n\t' + msg;
newErr.stack = err.stack;
if (isBrowser) {
newErr.message = err.message + '\n\t' + msg;
newErr.stack = err.stack;
}
else {
// node errors only look correct with the stack modified
newErr.message = err.message;
newErr.stack = err.stack + '\n\t' + msg;
}
}
else {
newErr = err + '\n\t' + msg;
Expand Down

0 comments on commit b97c6be

Please sign in to comment.