aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/listeners/other/promiseRejection.ts4
-rw-r--r--src/listeners/other/uncaughtException.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/listeners/other/promiseRejection.ts b/src/listeners/other/promiseRejection.ts
index ed0d35d..24493f7 100644
--- a/src/listeners/other/promiseRejection.ts
+++ b/src/listeners/other/promiseRejection.ts
@@ -10,13 +10,13 @@ export default class PromiseRejectionListener extends BushListener {
public override async exec(error: Error): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
- void client.console.error('PromiseRejection', `An unhanded promise rejection occurred:\n${error?.stack || error}`, false);
+ void client.console.error('PromiseRejection', `An unhanded promise rejection occurred:\n${error?.stack ?? error}`, false);
void client.console.channelError({
embeds: [
{
title: 'Unhandled promise rejection',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
- fields: [{ name: 'error', value: await util.codeblock(`${error?.stack || error}`, 1024, 'js') }],
+ fields: [{ name: 'error', value: await util.codeblock(`${error?.stack ?? error}`, 1024, 'js') }],
color: util.colors.error
}
]
diff --git a/src/listeners/other/uncaughtException.ts b/src/listeners/other/uncaughtException.ts
index 045e524..5f4bd46 100644
--- a/src/listeners/other/uncaughtException.ts
+++ b/src/listeners/other/uncaughtException.ts
@@ -10,13 +10,13 @@ export default class UncaughtExceptionListener extends BushListener {
public override async exec(error: Error): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
- void client.console.error('uncaughtException', `An uncaught exception occurred:\n${error?.stack || error}`, false);
+ void client.console.error('uncaughtException', `An uncaught exception occurred:\n${error?.stack ?? error}`, false);
void client.console.channelError({
embeds: [
{
title: 'An uncaught exception occurred',
// eslint-disable-next-line @typescript-eslint/no-base-to-string
- fields: [{ name: 'error', value: await util.codeblock(`${error?.stack || error}`, 1024, 'js') }],
+ fields: [{ name: 'error', value: await util.codeblock(`${error?.stack ?? error}`, 1024, 'js') }],
color: util.colors.error
}
]