aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/other
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-26 22:20:52 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-10-26 22:20:52 -0400
commita1ab06dcfccef90192b90910aecdddbc505eca00 (patch)
treed2938e97ac06fc62fe17f5ec1fa4d927dc2922a6 /src/listeners/other
parent3aeddeccc3765e532f6f965612873ab4a03bddd1 (diff)
downloadtanzanite-a1ab06dcfccef90192b90910aecdddbc505eca00.tar.gz
tanzanite-a1ab06dcfccef90192b90910aecdddbc505eca00.tar.bz2
tanzanite-a1ab06dcfccef90192b90910aecdddbc505eca00.zip
sentry stuff
Diffstat (limited to 'src/listeners/other')
-rw-r--r--src/listeners/other/promiseRejection.ts5
-rw-r--r--src/listeners/other/uncaughtException.ts5
-rw-r--r--src/listeners/other/warning.ts5
3 files changed, 15 insertions, 0 deletions
diff --git a/src/listeners/other/promiseRejection.ts b/src/listeners/other/promiseRejection.ts
index 45e647e..ad16773 100644
--- a/src/listeners/other/promiseRejection.ts
+++ b/src/listeners/other/promiseRejection.ts
@@ -1,4 +1,5 @@
import { BushListener } from '@lib';
+import { Severity } from '@sentry/node';
import CommandErrorListener from '../commands/commandError';
export default class PromiseRejectionListener extends BushListener {
@@ -10,6 +11,10 @@ export default class PromiseRejectionListener extends BushListener {
}
public override async exec(error: Error) {
+ client.sentry.captureException(error, {
+ level: Severity.Error
+ });
+
void client.console.error(
'promiseRejection',
`An unhanded promise rejection occurred:\n${typeof error == 'object' ? error.stack : error}`,
diff --git a/src/listeners/other/uncaughtException.ts b/src/listeners/other/uncaughtException.ts
index 8eb4294..0f8c17c 100644
--- a/src/listeners/other/uncaughtException.ts
+++ b/src/listeners/other/uncaughtException.ts
@@ -1,4 +1,5 @@
import { BushListener } from '@lib';
+import { Severity } from '@sentry/node';
import CommandErrorListener from '../commands/commandError';
export default class UncaughtExceptionListener extends BushListener {
@@ -10,6 +11,10 @@ export default class UncaughtExceptionListener extends BushListener {
}
public override async exec(error: Error) {
+ client.sentry.captureException(error, {
+ level: Severity.Error
+ });
+
void client.console.error(
'uncaughtException',
`An uncaught exception occurred:\n${typeof error == 'object' ? error.stack : error}`,
diff --git a/src/listeners/other/warning.ts b/src/listeners/other/warning.ts
index 51f67ba..bf1488f 100644
--- a/src/listeners/other/warning.ts
+++ b/src/listeners/other/warning.ts
@@ -1,4 +1,5 @@
import { BushListener } from '@lib';
+import { Severity } from '@sentry/node';
import CommandErrorListener from '../commands/commandError';
export default class WarningListener extends BushListener {
@@ -10,6 +11,10 @@ export default class WarningListener extends BushListener {
}
public override async exec(error: Error) {
+ client.sentry.captureException(error, {
+ level: Severity.Warning
+ });
+
void client.console.warn('warning', `A warning occurred:\n${typeof error == 'object' ? error.stack : error}`, false);
void client.console.channelError({
embeds: [