From eba0f1ef9b1fc7e7710f6f15b65029c1aae4bedd Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Mon, 19 Aug 2024 08:55:22 +0200 Subject: [PATCH] fix(api): send captured errors to Sentry. (#55877) --- api/src/routes/certificate.ts | 2 +- api/src/routes/donate.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/routes/certificate.ts b/api/src/routes/certificate.ts index 3afb7fd9ab6..d6a72827cbe 100644 --- a/api/src/routes/certificate.ts +++ b/api/src/routes/certificate.ts @@ -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); } } diff --git a/api/src/routes/donate.ts b/api/src/routes/donate.ts index a62b74e689a..1111ad85cb0 100644 --- a/api/src/routes/donate.ts +++ b/api/src/routes/donate.ts @@ -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.'