Skip to content

Conversation

krist7599555
Copy link
Contributor

handleErrorWithSentry, which is wrapper function, should be identity function (f(x) => x).

Implementation is fine, just the type mismatch from implementation.

export function handleErrorWithSentry(handleError: HandleServerError = defaultErrorHandler): HandleServerError {
return (input: { error: unknown; event: RequestEvent }): ReturnType<HandleServerError> => {
if (isNotFoundError(input)) {
return handleError(input);
}
captureException(input.error, scope => {
scope.addEventProcessor(event => {
addExceptionMechanism(event, {
type: 'sveltekit',
handled: false,
});
return event;
});
return scope;
});
return handleError(input);
};
}

krist7599555 and others added 2 commits September 20, 2023 02:15
handleErrorWithSentry should be identity function
`f(x) => x`
as a wrapper function
@Lms24 Lms24 changed the title fix(sveltekit): type handleErrorWithSentry is wrong fix(sveltekit): Adjust handleErrorWithSentry type Sep 20, 2023
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @krist7599555 thanks for contributing! Good catch!

(I fixed the linter error but other than that, this is good to go. We'll include this in today's release)

@Lms24 Lms24 merged commit 5f7df8c into getsentry:develop Sep 20, 2023
@AbhiPrasad
Copy link
Member

Fix was released with with https://github.com/getsentry/sentry-javascript/releases/tag/7.70.0. Thanks for your contribution @krist7599555!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants