Idiomatic way to send exceptions in Shadow Endpoints to Sentry #3768
-
Hi, I'm trying to add Sentry error handling to my SvelteKit app. Since implementing shadow endpoints (which are awesome!) I can't work out where to call For now, I've added this hacky code to <script context="module">
import {browser} from '$app/env';
export async function load({
error,
status,
url,
params,
props,
}) {
if (!browser && !error.sentry) {
const {captureException} = await import('$lib/errors/server.js');
// NB: this calls through to Sentry.captureException
const sentry = captureException({
error,
extra: {url, params, props},
});
Object.assign(error, {sentry});
}
return {
props: {
error,
status,
},
};
}
</script> Problems:
It seems like I need a new type of hook.
...but this isn't called when I throw an Error in an endpoint's |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
same here when using |
Beta Was this translation helpful? Give feedback.
-
I've raised an issue: #3807 |
Beta Was this translation helpful? Give feedback.
I've raised an issue: #3807