fix(api): send captured errors to Sentry. (#55877)

pull/55894/head
Oliver Eyton-Williams 2024-08-19 08:55:22 +02:00 committed by GitHub
parent 3bc0bda634
commit eba0f1ef9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -233,7 +233,7 @@ export const protectedCertificateRoutes: FastifyPluginCallbackTypebox = (
await fastify.sendEmail(notifyUser);
} catch (e) {
fastify.log.error(e);
// TODO: Log to Sentry
fastify.Sentry.captureException(e);
}
}

View File

@ -105,6 +105,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
} as const;
} catch (error) {
fastify.log.error(error);
fastify.Sentry.captureException(error);
void reply.code(500);
return {
type: 'danger',
@ -231,6 +232,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
});
} catch (error) {
fastify.log.error(error);
fastify.Sentry.captureException(error);
void reply.code(500);
return reply.send({
error: 'Donation failed due to a server error.'