better logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Elizabeth Hunt 2024-12-15 00:00:32 -08:00
parent 4fd40b1f9d
commit 82ad0bfc7f
Signed by: simponic
GPG Key ID: 2909B9A7FF6213EE

View File

@ -17,16 +17,19 @@ export const main = (port: number) => {
jobInsensitive.to.username = "****REDACTED****";
jobInsensitive.to.password = "****REDACTED****";
const uuid = crypto.randomUUID();
ConsoleLogger.log(
`Received email job: ${JSON.stringify(jobInsensitive)}`,
`[${uuid}] Received email job: ${JSON.stringify(jobInsensitive)}`,
)();
const performEmailTest = perform(job)();
return await performEmailTest
.then(() => {
ConsoleLogger.log(`[${uuid}] sucess`);
return Response.json({ success: true });
})
.catch((error) => {
ConsoleLogger.log(`[${uuid}] failure due to ${error.message}`);
return new Response(error.message, {
status: 400,
});