Skip to content

Commit 44ea132

Browse files
Merge branch 'master' into implement/ftr-configured-users
2 parents 74ed42a + 56010b1 commit 44ea132

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/setup_node_env/exit_on_warning.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,16 @@ if (process.noProcessWarnings !== true) {
3535

3636
process.exit(1);
3737
});
38+
39+
// While the above warning listener would also be called on
40+
// unhandledRejection warnings, we can give a better error message if we
41+
// handle them separately:
42+
process.on('unhandledRejection', function(reason) {
43+
console.error('Unhandled Promise rejection detected:');
44+
console.error();
45+
console.error(reason);
46+
console.error();
47+
console.error('Terminating process...');
48+
process.exit(1);
49+
});
3850
}

0 commit comments

Comments
 (0)