Skip to content

Commit

Permalink
Merge pull request #219 from mohd-akram/fix-debug
Browse files Browse the repository at this point in the history
Fix exception not printed when debugging
  • Loading branch information
LinusU authored Aug 9, 2018
2 parents 0270596 + 8c7a838 commit a52d786
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source-map-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,17 @@ function getErrorSource(error) {
function printErrorAndExit (error) {
var source = getErrorSource(error);

// Ensure error is printed synchronously and not truncated
if (process.stderr._handle && process.stderr._handle.setBlocking) {
process.stderr._handle.setBlocking(true);
}

if (source) {
fs.writeSync(2, "\n" + source + "\n");
console.error();
console.error(source);
}

fs.writeSync(2, error.stack + "\n");
console.error(error.stack);
process.exit(1);
}

Expand Down

0 comments on commit a52d786

Please sign in to comment.