@sentry/nextjs
Version:
Official Sentry SDK for Next.js
27 lines (24 loc) • 1.08 kB
JavaScript
import { isPrerenderControlFlowError } from '../nextNavigationErrorUtils.js';
const dropReactControlFlowErrorsEventProcessor = Object.assign(
((event, hint) => {
if (event.type !== void 0) {
return event;
}
const originalException = hint.originalException;
const isPostponeError = typeof originalException === "object" && originalException !== null && "$$typeof" in originalException && originalException.$$typeof === /* @__PURE__ */ Symbol.for("react.postpone");
if (isPostponeError) {
return null;
}
if (isPrerenderControlFlowError(originalException)) {
return null;
}
const exceptionMessage = event.exception?.values?.[0]?.value;
if (exceptionMessage?.includes("Suspense Exception: This is not a real error!") || exceptionMessage?.includes("Suspense Exception: This is not a real error, and should not leak")) {
return null;
}
return event;
}),
{ id: "DropReactControlFlowErrors" }
);
export { dropReactControlFlowErrorsEventProcessor };
//# sourceMappingURL=dropReactControlFlowErrors.js.map