generated from nhcarrigan/template
fix: forgot one
This commit is contained in:
+2
-2
@@ -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;
|
||||||
|
|||||||
@@ -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));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user