fix(api): send captured errors to Sentry. (#55877)
parent
3bc0bda634
commit
eba0f1ef9b
|
@ -233,7 +233,7 @@ export const protectedCertificateRoutes: FastifyPluginCallbackTypebox = (
|
||||||
await fastify.sendEmail(notifyUser);
|
await fastify.sendEmail(notifyUser);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
fastify.log.error(e);
|
fastify.log.error(e);
|
||||||
// TODO: Log to Sentry
|
fastify.Sentry.captureException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
|
||||||
} as const;
|
} as const;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
fastify.log.error(error);
|
fastify.log.error(error);
|
||||||
|
fastify.Sentry.captureException(error);
|
||||||
void reply.code(500);
|
void reply.code(500);
|
||||||
return {
|
return {
|
||||||
type: 'danger',
|
type: 'danger',
|
||||||
|
@ -231,6 +232,7 @@ export const donateRoutes: FastifyPluginCallbackTypebox = (
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
fastify.log.error(error);
|
fastify.log.error(error);
|
||||||
|
fastify.Sentry.captureException(error);
|
||||||
void reply.code(500);
|
void reply.code(500);
|
||||||
return reply.send({
|
return reply.send({
|
||||||
error: 'Donation failed due to a server error.'
|
error: 'Donation failed due to a server error.'
|
||||||
|
|
Loading…
Reference in New Issue