Handle unhandled rejections the same way as uncaught exceptions
parent
f5caa80c4c
commit
c9e0dbf040
|
@ -17,7 +17,7 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error handling
|
// Error handling
|
||||||
process.on("uncaughtException", err => {
|
function errorHandler(err) {
|
||||||
// Unknown message types (nitro boosting messages at the time) should be safe to ignore
|
// Unknown message types (nitro boosting messages at the time) should be safe to ignore
|
||||||
if (err && err.message && err.message.startsWith("Unhandled MESSAGE_CREATE type")) {
|
if (err && err.message && err.message.startsWith("Unhandled MESSAGE_CREATE type")) {
|
||||||
return;
|
return;
|
||||||
|
@ -26,7 +26,9 @@ process.on("uncaughtException", err => {
|
||||||
// For everything else, crash with the error
|
// For everything else, crash with the error
|
||||||
console.error(err);
|
console.error(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
}
|
||||||
|
process.on("uncaughtException", errorHandler);
|
||||||
|
process.on("unhandledRejection", errorHandler);
|
||||||
|
|
||||||
let testedPackage = "";
|
let testedPackage = "";
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue