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

Add c.Response().Committed check in example customHTTPErrorHandler #359

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

briskt
Copy link
Contributor

@briskt briskt commented Dec 7, 2024

This doc updated addresses labstack/echo#1948 in the best way I can guess it should be handled. @markhildreth-gravity summarized that issue best by offering three solutions:

1.) It's echo's responsibility to put this complexity into c.Error(), so that no third party needs to worry about this.
2.) It's the error handler's responsibility, in which case the documentation should be updated, or,
3.) It's the middleware's responsibility, in which case that documentation should be updated.

The first seems inappropriate since most handlers won't use c.Error (Its doc says this: "Avoid using this method in handlers as no middleware will be able to effectively handle errors after that.") The third puts more burden on developers since middleware functions are more common than error handlers.

@aldas aldas merged commit ab6af18 into labstack:master Dec 8, 2024
1 check passed
@briskt briskt deleted the patch-1 branch December 8, 2024 14:17
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