aboutsummaryrefslogtreecommitdiff
path: root/src/listeners
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-13 20:22:20 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-12-13 20:22:20 -0500
commit9f705a0e5a90177784d45d20200dbaa46a569e78 (patch)
tree15390ea91d0ff3c3912be2b8cbe354f8703bb652 /src/listeners
parent2d6bb50ce8c979e543f0d2831b3db9d8644be477 (diff)
downloadtanzanite-9f705a0e5a90177784d45d20200dbaa46a569e78.tar.gz
tanzanite-9f705a0e5a90177784d45d20200dbaa46a569e78.tar.bz2
tanzanite-9f705a0e5a90177784d45d20200dbaa46a569e78.zip
fix more bugs
Diffstat (limited to 'src/listeners')
-rw-r--r--src/listeners/other/promiseRejection.ts5
-rw-r--r--src/listeners/other/uncaughtException.ts4
2 files changed, 9 insertions, 0 deletions
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
});