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

recoverer: don't recover http.ErrAbortHandler #624

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

drakkan
Copy link
Contributor

@drakkan drakkan commented May 29, 2021

This error is generally used to abort a request while streaming a response
so it should not be recovered otherwise the request is not aborted and
the client does not detect the error.

In my use case I'm streaming a zip file directly to the client (without writing it to the disk). If an error happen while streaming the request body I return http.ErrAbortHandler to abort the request without logging a panic. This is the only way to report an error to the client/browser. So this error should not be recovered otherwise the request is not aborted and the client does not detect the error.

My use case is quite similar to the one described here

This error is generally used to abort a request while streaming a response
so it should not be recovered otherwise the request is not aborted and
the client does not detect the error

Fixes go-chi#588
@pkieltyka pkieltyka merged commit 7dbe9a0 into go-chi:master Jan 3, 2022
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