generated from nhcarrigan/template
fix: send everything
This commit is contained in:
@ -110,6 +110,7 @@ export const instantiateServer = (): void => {
|
|||||||
}
|
}
|
||||||
const { application, message } = request.body;
|
const { application, message } = request.body;
|
||||||
await sendMail(`[UPTIME]: ${application}`, message);
|
await sendMail(`[UPTIME]: ${application}`, message);
|
||||||
|
await sendDiscord(`[UPTIME]: ${application}`, message);
|
||||||
await response.status(200).send({ success: true });
|
await response.status(200).send({ success: true });
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -120,11 +121,13 @@ export const instantiateServer = (): void => {
|
|||||||
const { message, stack } = error;
|
const { message, stack } = error;
|
||||||
const context = "Server Startup";
|
const context = "Server Startup";
|
||||||
void sendMail(`[ERROR]: ${context} - ${application}`, `${message}\n\n${String(stack)}`);
|
void sendMail(`[ERROR]: ${context} - ${application}`, `${message}\n\n${String(stack)}`);
|
||||||
|
void sendDiscord(`[ERROR]: ${context} - ${application}`, `${message}\n\n\`\`\`\n${String(stack)}\n\`\`\``);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const level = "debug";
|
const level = "debug";
|
||||||
const message = `Server listening on port 5003.`;
|
const message = `Server listening on port 5003.`;
|
||||||
void sendMail(`[${level}]: ${application}`, message);
|
void sendMail(`[${level}]: ${application}`, message);
|
||||||
|
void sendDiscord(`[${level}]: ${application}`, message);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const application = "Alert Server";
|
const application = "Alert Server";
|
||||||
@ -132,5 +135,6 @@ export const instantiateServer = (): void => {
|
|||||||
// 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;
|
||||||
void sendMail(`[ERROR]: ${context} - ${application}`, `${message}\n\n${stack}`);
|
void sendMail(`[ERROR]: ${context} - ${application}`, `${message}\n\n${stack}`);
|
||||||
|
void sendDiscord(`[ERROR]: ${context} - ${application}`, `${message}\n\n\`\`\`\n${stack}\n\`\`\``);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user