fix: ignore intentional redirect errors in posthog
Build and Push Image / docker (push) Successful in 5m22s
Build and Push Image / docker (push) Successful in 5m22s
This commit is contained in:
@@ -6,4 +6,15 @@ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!, {
|
||||
defaults: "2026-01-30",
|
||||
capture_exceptions: true,
|
||||
debug: process.env.ENVIRONMENT === "development",
|
||||
|
||||
before_send: (event) => {
|
||||
if (event?.event === "$exception") {
|
||||
const exceptionList = event.properties.$exception_list || [];
|
||||
const exception = exceptionList[0];
|
||||
if (exception?.value === "NEXT_REDIRECT") {
|
||||
return null; // Drop it entirely
|
||||
}
|
||||
}
|
||||
return event;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user