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.username = "****REDACTED****";
jobInsensitive.to.password = "****REDACTED****"; jobInsensitive.to.password = "****REDACTED****";
const uuid = crypto.randomUUID();
ConsoleLogger.log( ConsoleLogger.log(
`Received email job: ${JSON.stringify(jobInsensitive)}`, `[${uuid}] Received email job: ${JSON.stringify(jobInsensitive)}`,
)(); )();
const performEmailTest = perform(job)(); const performEmailTest = perform(job)();
return await performEmailTest return await performEmailTest
.then(() => { .then(() => {
ConsoleLogger.log(`[${uuid}] sucess`);
return Response.json({ success: true }); return Response.json({ success: true });
}) })
.catch((error) => { .catch((error) => {
ConsoleLogger.log(`[${uuid}] failure due to ${error.message}`);
return new Response(error.message, { return new Response(error.message, {
status: 400, status: 400,
}); });