Skip to content

Commit

Permalink
Merge branch 'master' into implement/ftr-configured-users
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Mar 17, 2020
2 parents 74ed42a + 56010b1 commit 44ea132
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/setup_node_env/exit_on_warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,16 @@ if (process.noProcessWarnings !== true) {

process.exit(1);
});

// While the above warning listener would also be called on
// unhandledRejection warnings, we can give a better error message if we
// handle them separately:
process.on('unhandledRejection', function(reason) {
console.error('Unhandled Promise rejection detected:');
console.error();
console.error(reason);
console.error();
console.error('Terminating process...');
process.exit(1);
});
}

0 comments on commit 44ea132

Please sign in to comment.