Skip to content

Commit eba0f1e

Browse files
fix(api): send captured errors to Sentry. (freeCodeCamp#55877)
1 parent 3bc0bda commit eba0f1e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

api/src/routes/certificate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export const protectedCertificateRoutes: FastifyPluginCallbackTypebox = (
233233
await fastify.sendEmail(notifyUser);
234234
} catch (e) {
235235
fastify.log.error(e);
236-
// TODO: Log to Sentry
236+
fastify.Sentry.captureException(e);
237237
}
238238
}
239239

api/src/routes/donate.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
105105
} as const;
106106
} catch (error) {
107107
fastify.log.error(error);
108+
fastify.Sentry.captureException(error);
108109
void reply.code(500);
109110
return {
110111
type: 'danger',
@@ -231,6 +232,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
231232
});
232233
} catch (error) {
233234
fastify.log.error(error);
235+
fastify.Sentry.captureException(error);
234236
void reply.code(500);
235237
return reply.send({
236238
error: 'Donation failed due to a server error.'

0 commit comments

Comments
 (0)