feat: send discord logs
Some checks failed
Code Analysis / SonarQube (push) Failing after 19s
Node.js CI / Lint and Test (push) Failing after 35s

This commit is contained in:
2025-06-21 17:35:50 -07:00
parent 088027086e
commit 5aa47190d6
3 changed files with 54 additions and 1 deletions

View File

@ -6,6 +6,7 @@
import fastify from "fastify";
import { auth } from "../modules/auth.js";
import { sendDiscord } from "../modules/discord.js";
import { sendMail } from "../modules/sendMail.js";
import { errorSchema } from "../schemas/errorSchema.js";
import { logSchema } from "../schemas/logSchema.js";
@ -89,6 +90,10 @@ export const instantiateServer = (): void => {
}
const { application, context, stack, message } = request.body;
await sendMail(`[ERROR]: ${context} - ${application}`, `${message}\n\n${stack}`);
await sendDiscord(
`[ERROR]: ${context} - ${application}`,
`${message}\n\n\`\`\`\n${stack}\n\`\`\``,
);
await response.status(200).send({ success: true });
},
);