diff --git a/src/helpers/functions/errorHandler.ts b/src/helpers/functions/errorHandler.ts index c8a70ecc3..aa3b133f9 100644 --- a/src/helpers/functions/errorHandler.ts +++ b/src/helpers/functions/errorHandler.ts @@ -123,7 +123,7 @@ export async function errorHandler(client: Client, error: any, type: string) { let eprotoError = false; let description = error.stack; - let codeBlocks = " "; + let codeBlocks = ""; if (error.isAxiosError) { // axios errors are JSON diff --git a/src/helpers/logger.ts b/src/helpers/logger.ts index c552fc517..8d7709151 100644 --- a/src/helpers/logger.ts +++ b/src/helpers/logger.ts @@ -26,6 +26,9 @@ export async function devLogger(client: Client, description: string, params: Log const channel = client.channels.cache.get(client.tokens.errorChannel) as TextChannel; if (!channel) return; // avoid infinite loop when crash is outside of client + if (params.codeBlocks !== null && params.codeBlocks !== undefined) + description = `\`\`\`${params.codeBlocks}\n${description}\`\`\``; + const embed = new EmbedBuilder() .setTitle(params.title ?? "Unhandled Rejection") .setDescription(description)