diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-27 22:39:07 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-05-27 22:39:07 -0400 |
commit | 94c20f17f1a87e594fc07a75eb6026891086c67c (patch) | |
tree | f32942ce07630352afbf4d7be2b718fc9724502c /src/listeners/other | |
parent | f718df9321f2ff28a5a1f20d53e474fbf5998d6e (diff) | |
download | tanzanite-94c20f17f1a87e594fc07a75eb6026891086c67c.tar.gz tanzanite-94c20f17f1a87e594fc07a75eb6026891086c67c.tar.bz2 tanzanite-94c20f17f1a87e594fc07a75eb6026891086c67c.zip |
fix: use util#formatError
Diffstat (limited to 'src/listeners/other')
-rw-r--r-- | src/listeners/other/promiseRejection.ts | 6 | ||||
-rw-r--r-- | src/listeners/other/uncaughtException.ts | 6 | ||||
-rw-r--r-- | src/listeners/other/warning.ts | 2 |
3 files changed, 3 insertions, 11 deletions
diff --git a/src/listeners/other/promiseRejection.ts b/src/listeners/other/promiseRejection.ts index 69a62c7..270db46 100644 --- a/src/listeners/other/promiseRejection.ts +++ b/src/listeners/other/promiseRejection.ts @@ -21,11 +21,7 @@ export default class PromiseRejectionListener extends BushListener { level: Severity.Error }); - void client.console.error( - 'promiseRejection', - `An unhanded promise rejection occurred:\n${typeof error == 'object' ? error.stack : error}`, - false - ); + void client.console.error('promiseRejection', `An unhanded promise rejection occurred:\n${util.formatError(error)}`, false); if (!error.message.includes('reason: getaddrinfo ENOTFOUND canary.discord.com')) void client.console.channelError({ embeds: [await CommandErrorListener.generateErrorEmbed({ type: 'unhandledRejection', error: error })] diff --git a/src/listeners/other/uncaughtException.ts b/src/listeners/other/uncaughtException.ts index b650620..b12f76d 100644 --- a/src/listeners/other/uncaughtException.ts +++ b/src/listeners/other/uncaughtException.ts @@ -20,11 +20,7 @@ export default class UncaughtExceptionListener extends BushListener { level: Severity.Error }); - void client.console.error( - 'uncaughtException', - `An uncaught exception occurred:\n${typeof error == 'object' ? error.stack : error}`, - false - ); + void client.console.error('uncaughtException', `An uncaught exception occurred:\n${util.formatError(error)}`, false); void client.console.channelError({ embeds: [await CommandErrorListener.generateErrorEmbed({ type: 'uncaughtException', error: error })] }); diff --git a/src/listeners/other/warning.ts b/src/listeners/other/warning.ts index 57f2a7d..2412221 100644 --- a/src/listeners/other/warning.ts +++ b/src/listeners/other/warning.ts @@ -17,7 +17,7 @@ export default class WarningListener extends BushListener { level: Severity.Warning }); - void client.console.warn('warning', `A warning occurred:\n${typeof error == 'object' ? error.stack : error}`, false); + void client.console.warn('warning', `A warning occurred:\n${util.formatError(error)}`, false); void client.console.channelError({ embeds: [ (await CommandErrorListener.generateErrorEmbed({ type: 'unhandledRejection', error: error })) |