From 9f705a0e5a90177784d45d20200dbaa46a569e78 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 13 Dec 2021 20:22:20 -0500 Subject: fix more bugs --- src/listeners/other/promiseRejection.ts | 5 +++++ src/listeners/other/uncaughtException.ts | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'src/listeners/other') diff --git a/src/listeners/other/promiseRejection.ts b/src/listeners/other/promiseRejection.ts index 699b676..69a62c7 100644 --- a/src/listeners/other/promiseRejection.ts +++ b/src/listeners/other/promiseRejection.ts @@ -12,6 +12,11 @@ export default class PromiseRejectionListener extends BushListener { } public override async exec(error: Error) { + process.listeners('unhandledRejection').forEach((listener) => { + if (listener.toString() === this.exec.toString()) return; + process.removeListener('unhandledRejection', listener); + }); + client.sentry.captureException(error, { level: Severity.Error }); diff --git a/src/listeners/other/uncaughtException.ts b/src/listeners/other/uncaughtException.ts index 34dcdd6..b650620 100644 --- a/src/listeners/other/uncaughtException.ts +++ b/src/listeners/other/uncaughtException.ts @@ -12,6 +12,10 @@ export default class UncaughtExceptionListener extends BushListener { } public override async exec(error: Error) { + process.listeners('uncaughtException').forEach((listener) => { + if (listener.toString() === this.exec.toString()) return; + process.removeListener('uncaughtException', listener); + }); client.sentry.captureException(error, { level: Severity.Error }); -- cgit