From b5fe1de87be6e428ff8d9e6d6660c43bb022c20c Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 5 Jun 2019 23:11:08 +0300 Subject: [PATCH] Ignore errors from unknown message types --- src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.js b/src/index.js index 85e0a95..ca4d398 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,18 @@ try { process.exit(1); } +// Error handling +process.on('uncaughtException', err => { + // 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')) { + return; + } + + // For everything else, crash with the error + console.error(err); + process.exit(1); +}); + let testedPackage = ''; try { const packageJson = require('../package.json');