Closed
Description
The incorrect behaviour seems to be present in @sentry/[email protected]
- after following the setup instructions, with a pretty vanilla SvelteKit application, redirects from within the server hooks handle()
function are being reported to Sentry as errors. Or rather, we see the following error since a SvelteKit redirect is not an instance of class Error
:
Object.captureException
💀 Unhandled Non-Error exception captured with keys: location, status
A minimal reproduction would be something like this:
// hooks.server.ts
export const handle = async ({ event, resolve }) => {
// dummy logic to handle users who aren't logged in
if (event.url.pathname !== '/login') {
throw redirect(303, '/login');
}
const response = await resolve(event);
return response;
};
Originally posted by @abirtley in #7719 (comment)