-
Notifications
You must be signed in to change notification settings - Fork 97
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
Typed errors #58
Typed errors #58
Conversation
Useful in the environment where multiple connectors exist to disambiguate which connector failed
I'd consider making a change, but not to an |
What, in particular, do you like about the
The main motivation to expose the typed errors as part of the public API is to actually expose what can go wrong with the implementation and where. It is true what it somewhat restricts the ways the implementation can change it's behavior without issuing an API-breaking code change (i.e. a major version). But - and it's a big but - if the errors are not typed, and implementation is allowed to change in such a way that error behavior changes but there's no major version bump - it's kind of worse cause it might break the "unwritten" API contract for users that wouldn't expect that. |
One other thing I've noticed is that the
|
Closes #57
If you want to know what errors to expect - this is the best way.
Properly utilizes
Error::source
to expose error cause.The interface I implemented is a bit different: it's more permissive and therefore accepts more error types.
It also exposes the
ForceHttpsButUriNotHttps
properly so that it can be handled (which I have to do since I haveforce_https
set totrue
).