-
Notifications
You must be signed in to change notification settings - Fork 29
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
Why custom validation errors are embedded in a HTTPError ? #53
Comments
Hi, I agree with your point. Would you make a PR to support this enhancement |
@malcommac ok, I'll try to find the time for that in a near future |
Ok, I gave it a try, but changing the |
I have a custom validator that parses the JSON response and tries to build an Error struct.
If it builds the error successfully, my validator will return with a
.failChain(responseError)
, but in my catch at the call site, the error is still embedded into aHTTPError
, which makes the catch a bit convoluted:Question: what's your rationale behind automatically nesting the validator custom errors in a
HTTPError
?I would probably prefer to have 2 dedicated catches:
So I can ignore the HTTPError and fallback to a generic catch if I'd like to.. and I could also avoid leaking the RealHTTP implementation/imports in all my services ;)
The text was updated successfully, but these errors were encountered: