chore: Only import Sentry when needed (#18882)

This commit is contained in:
Alex van Andel authored and GitHub committed 2025-01-25 10:41:44 +00:00
1 parent 30e576377a
commit c5d0d66a26
1 file changed
+2 -3
@@ -1,5 +1,3 @@
import { captureException as SentryCaptureException } from "@sentry/nextjs";
import { redactError } from "@calcom/lib/redactError";
import { middleware } from "../trpc";
@@ -11,7 +9,8 @@ const captureErrorsMiddleware = middleware(async ({ next }) => {
if (!cause) {
return result;
}
SentryCaptureException(cause);
const { captureException } = await import("@sentry/nextjs");
captureException(cause);
throw redactError(cause);
}
return result;