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 panic + improve panic handling #1032

Merged
merged 5 commits into from
Jun 1, 2022
Merged

Fix panic + improve panic handling #1032

merged 5 commits into from
Jun 1, 2022

Conversation

JamesMurkin
Copy link
Contributor

@JamesMurkin JamesMurkin commented May 31, 2022

The recovery interceptor must be the first interceptor

So that it can handle panics in the endpoint code + all subsequent interceptor code (i.e it wraps all the code that can panic)

Currently it is not the first interceptor, so if any interceptor that was added before it panics, the server will crash

Copy link
Contributor

@kannon92 kannon92 left a comment

Choose a reason for hiding this comment

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

I got bit by this earlier today, I think.

Would it be possible to add tests for Errors?

@severinson
Copy link
Contributor

I got bit by this earlier today, I think.

Would it be possible to add tests for Errors?

I think we should add tests for the code that generates errors to ensure they don't operate on nil values.

@JamesMurkin JamesMurkin merged commit 9541160 into master Jun 1, 2022
@JamesMurkin JamesMurkin deleted the panic_fix branch June 1, 2022 21:21
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

4 participants