Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more details to error msgs #217

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/api/src/routes/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ const uploadRoute: FastifyPluginAsync = async function (server) {
} catch (err) {
Sentry.captureException(err);
await postSlackMessage({
text: `Failed to upload file with error: ${
text: `Failed to parse uploaded file with error: ${
err.detail ?? err.message
}. Request ID: ${request.id}`,
}. Request ID: ${request.id}. ${
request.headers["api-user"]
? `API User: ${request.headers["api-user"]}`
: ""
}}`,
});
throw err;
}
Expand Down
8 changes: 6 additions & 2 deletions apps/api/src/services/sendgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export async function sendReportEmail({
const emailSend = await sgMail.send(msg);

if (emailSend[0].statusCode !== 202) {
throw new Error(`Failed to send Email. Status: ${emailSend[0].statusCode}`);
throw new Error(
`Failed to send Email. Status: ${emailSend[0].statusCode}. Recipient: ${email}}`,
);
}
}

Expand All @@ -53,6 +55,8 @@ export async function sendFailureEmail({
const emailSend = await sgMail.send(msg);

if (emailSend[0].statusCode !== 202) {
throw new Error(`Failed to send Email. Status: ${emailSend[0].statusCode}`);
throw new Error(
`Failed to send Email. Status: ${emailSend[0].statusCode}. Recipient: ${email}`,
);
}
}
Loading