Skip to content

fix(sveltekit): Log error to console by default in handleErrorWithSentry - #7674

Merged
Lms24 merged 3 commits into
developfrom
lms/sveltekit-fix-errorhandler-log-swallowed
Mar 30, 2023
Merged

fix(sveltekit): Log error to console by default in handleErrorWithSentry#7674
Lms24 merged 3 commits into
developfrom
lms/sveltekit-fix-errorhandler-log-swallowed

Conversation

@Lms24

Copy link
Copy Markdown
Member

Previously, our handleErrorWithSentry wrapper did nothing if users didn't provide a custom error handler as an argument. While IMO it's good that the error handler is an optional parameter, this swallowed errors and didn't log them to the console anymore.

This PR fixes that by adding a default error handler which our wrapper invokes if no custom handler was provided. The client- and server default handlers log the error to the console, exactly like the default handlers by SvelteKit (client, server).

@Lms24Lms24 self-assigned this Mar 30, 2023
@Lms24
Lms24 requested a review from AbhiPrasadMarch 30, 2023 13:52
@Lms24
Lms24 merged commit 79ca4a7 into developMar 30, 2023
@Lms24
Lms24 deleted the lms/sveltekit-fix-errorhandler-log-swallowed branch March 30, 2023 14:27
Sign up for freeto 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.

2 participants

@Lms24@AbhiPrasad