chore: Only import Sentry when needed (#18882)
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user