fix: forgot one
Code Analysis / SonarQube (push) Failing after 20s
Node.js CI / Lint and Test (push) Successful in 49s

This commit is contained in:
2025-09-25 10:53:38 -07:00
parent 10e3a58d6b
commit 31c129da24
2 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -331,7 +331,7 @@ export const instantiateServer = async(): Promise<void> => {
server.listen({ port: 5003 }, (error) => { server.listen({ port: 5003 }, (error) => {
// eslint-disable-next-line max-lines -- This block is long because of logging. // eslint-disable-next-line max-lines -- This block is long because of logging.
const application = "Alert Server"; const application = "Rosalia Nightsong";
if (error) { if (error) {
const { message, stack } = error; const { message, stack } = error;
const context = "Server Startup"; const context = "Server Startup";
@@ -348,7 +348,7 @@ export const instantiateServer = async(): Promise<void> => {
void pipeLog(application, message, level); void pipeLog(application, message, level);
}); });
} catch (error) { } catch (error) {
const application = "Alert Server"; const application = "Rosalia Nightsong";
const context = "Server Startup"; const context = "Server Startup";
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Totally being lazy. // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Totally being lazy.
const { message, stack } = error as Error; const { message, stack } = error as Error;
+9 -4
View File
@@ -4,7 +4,7 @@
* @author Naomi Carrigan * @author Naomi Carrigan
*/ */
import { sendDiscord } from "../modules/discord.js"; import { pipeLog } from "../modules/pipeLog.js";
import { sendMail } from "../modules/sendMail.js"; import { sendMail } from "../modules/sendMail.js";
/** /**
@@ -17,9 +17,10 @@ export const errorHandler = async(
context: string, context: string,
): Promise<void> => { ): Promise<void> => {
if (error instanceof Error) { if (error instanceof Error) {
await sendDiscord( await pipeLog(
"Rosalia Nightsong",
`[ERROR] ${context}: ${error.message}`, `[ERROR] ${context}: ${error.message}`,
JSON.stringify(error, null, 2), "error",
); );
await sendMail( await sendMail(
`[ERROR] ${context}: ${error.message}`, `[ERROR] ${context}: ${error.message}`,
@@ -27,6 +28,10 @@ export const errorHandler = async(
); );
return; 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)); await sendMail(`[ERROR] ${context}`, JSON.stringify(error, null, 2));
}; };