Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sveltekit): Adjust handleErrorWithSentry type #9054

Merged
merged 2 commits into from Sep 20, 2023

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
31 checks passed
@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.

None yet

3 participants