From 03dce9538885215cac545f82a7313aa231b9a157 Mon Sep 17 00:00:00 2001 From: Alan Le Ruyet Date: Thu, 14 Dec 2023 18:39:45 +0100 Subject: [PATCH] feat: sending webhook zod error to sentry because we want to know --- server/src/http/middlewares/errorMiddleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/http/middlewares/errorMiddleware.ts b/server/src/http/middlewares/errorMiddleware.ts index 356ab52687..847d5cfbd6 100644 --- a/server/src/http/middlewares/errorMiddleware.ts +++ b/server/src/http/middlewares/errorMiddleware.ts @@ -64,7 +64,7 @@ export function errorMiddleware(server: Server) { ...(error.data ? { data: error.data } : {}), } - if (error.output.statusCode >= 500) { + if (error.output.statusCode >= 500 || (_request.url.startsWith("/api/emails/webhook") && error.output.statusCode >= 400)) { server.log.error(rawError) captureException(rawError) }