Skip to content

fix: recover from panic in handlers #137

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

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

acouvreur
Copy link
Contributor

@acouvreur acouvreur commented Mar 6, 2025

x/sync/errgroup does not currently propagate recovers, see golang/go#53757

Hey @cbrgm, this pull request will prevent the event handler from crashing on panic. It cannot be patch on around the handler because of how errgroup works.

So this PR simply adds a recover on top of each handler et set a panic recovered error

@acouvreur acouvreur requested a review from cbrgm as a code owner March 6, 2025 20:01
x/sync/errgroup does not currently propagate recovers, see golang/go#53757
@acouvreur acouvreur force-pushed the recover-from-panics branch from 98417f6 to 3af6154 Compare March 6, 2025 20:06
@cbrgm cbrgm merged commit d1c62ad into cbrgm:main Mar 6, 2025
4 checks passed
@cbrgm
Copy link
Owner

cbrgm commented Mar 6, 2025

Released in v2.0.1, thanks!

@acouvreur acouvreur deleted the recover-from-panics branch March 6, 2025 20:32
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.

2 participants