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

Wrapped errors are not handled #2

Open
fabiante opened this issue Sep 7, 2023 · 1 comment
Open

Wrapped errors are not handled #2

fabiante opened this issue Sep 7, 2023 · 1 comment

Comments

@fabiante
Copy link
Contributor

fabiante commented Sep 7, 2023

Hi there!

I'd like to use your middleware but noticed that it does not correctly handle wrapped errors. I opened a PR which adds a test case showing the behaviour #1.

I have not yet looked into why this happens. Before I tried your middleware, I used errors.Is to manually map custom errors onto http status codes. Generally the usage of errors.Is seems to be the right choice.

@richzw
Copy link
Owner

richzw commented Sep 8, 2023

@fabiante Thank you very much for your issue. I think the reason is that only the first parameter of errors.is was Unwrap. Some comments were added to the PR.

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

No branches or pull requests

2 participants