We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 74ed42a + 56010b1 commit 44ea132Copy full SHA for 44ea132
src/setup_node_env/exit_on_warning.js
@@ -35,4 +35,16 @@ if (process.noProcessWarnings !== true) {
35
36
process.exit(1);
37
});
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
47
+ console.error('Terminating process...');
48
+ process.exit(1);
49
+ });
50
}
0 commit comments