From 31c129da2419534011dcb471ca6f7e232b413d47 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Thu, 25 Sep 2025 10:53:38 -0700 Subject: [PATCH] fix: forgot one --- src/server/serve.ts | 4 ++-- src/utils/errorHandler.ts | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/server/serve.ts b/src/server/serve.ts index 33265d9..cafa759 100644 --- a/src/server/serve.ts +++ b/src/server/serve.ts @@ -331,7 +331,7 @@ export const instantiateServer = async(): Promise => { server.listen({ port: 5003 }, (error) => { // eslint-disable-next-line max-lines -- This block is long because of logging. - const application = "Alert Server"; + const application = "Rosalia Nightsong"; if (error) { const { message, stack } = error; const context = "Server Startup"; @@ -348,7 +348,7 @@ export const instantiateServer = async(): Promise => { void pipeLog(application, message, level); }); } catch (error) { - const application = "Alert Server"; + const application = "Rosalia Nightsong"; const context = "Server Startup"; // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Totally being lazy. const { message, stack } = error as Error; diff --git a/src/utils/errorHandler.ts b/src/utils/errorHandler.ts index 78eae26..d50ebdf 100644 --- a/src/utils/errorHandler.ts +++ b/src/utils/errorHandler.ts @@ -4,7 +4,7 @@ * @author Naomi Carrigan */ -import { sendDiscord } from "../modules/discord.js"; +import { pipeLog } from "../modules/pipeLog.js"; import { sendMail } from "../modules/sendMail.js"; /** @@ -17,9 +17,10 @@ export const errorHandler = async( context: string, ): Promise => { if (error instanceof Error) { - await sendDiscord( + await pipeLog( + "Rosalia Nightsong", `[ERROR] ${context}: ${error.message}`, - JSON.stringify(error, null, 2), + "error", ); await sendMail( `[ERROR] ${context}: ${error.message}`, @@ -27,6 +28,10 @@ export const errorHandler = async( ); return; } - await sendDiscord(`[ERROR] ${context}`, JSON.stringify(error, null, 2)); + await pipeLog( + "Rosalia Nightsong", + `[ERROR] ${context}: ${JSON.stringify(error)}`, + "error", + ); await sendMail(`[ERROR] ${context}`, JSON.stringify(error, null, 2)); };