-
Notifications
You must be signed in to change notification settings - Fork 55
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
refactor: improved error handling and error types #226
Conversation
most all current tests passed... not sure how to get info from these "Basic" checks. clicking the links end up all being self referential 😵 |
@cdaringe thanks a lot for your contribution! 🚀 Here is the error log for the failed case:
|
Related to #208 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks very good and thanks for contribution. Left few comments.
Hi @cdaringe, could you please address the review comments? Let us know if you need any assistance in order to finish this PR 🙂 |
got some tests goin too: 8ce133c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks a lot
@cdaringe we're almost ready to merge this PR, could you please check the unresolved comments? |
problem
Error handling is not consistent or helpful in various cases, emitting generic and unhelpful messages. See #225
solution
The current strategy is to funnel all possible failure modes in the HTTP client down through the
handleError
function. This pattern exists because there is are adapters to a generic HTTP client interface, but adapters do not need to map any error cases in. To rework that pattern is a massive refactor, likely out of scope of this PR.Thus, the approach taken here is to map failure types into expected failure types, and match (non-exhaustively) on those failure types to extract relevant information. This approach is nice because it's simple. It's a bit of a leaky abstraction, because now
handlerError
must know about all error types. An improved implementation later could be having Error type mappings in the HTTP client interface and the adapters themselves.The solution does the following:
todo