-
Notifications
You must be signed in to change notification settings - Fork 89
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
Slightly improve API error handling #4565
Conversation
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.
Good stuff,
Few comments, address them if you'd like, but they are non-blocking.
0177a60
to
cf9789e
Compare
This commit tries to fix the "FromHttpResponse" function. Returning 2 errors from a function can be confusing and uncommon in Golang, especially if the function only returns these 2 errors. The new code code will return one error, which is always an APIError, and it also improves the error messaging wording, adding more details in the output. Several more tweaks can be done to the current error message handling if needed.
cf9789e
to
72e454e
Compare
What is the status of this PR? @jamlo feel free to merge if all comments are addressed |
@wdbaruni since this PR was created (through a fork) before I had access to the repo, I will close this one, and create another one from a branch to close the loop. |
Closing this PR in favor of #4607 |
This PR tries to fix the "FromHttpResponse" function. Returning 2 errors from a function can be confusing and uncommon in Golang, especially if the function only returns these 2 errors. The new code will return one error, which is always an APIError, and it also improves the error messaging wording, adding more details in the output. Several more tweaks can be done to the current error message handling if needed. Note: this is identical to [PR 4565](#4565), though created from a branch, and not a fork.
This commit tries to fix the "FromHttpResponse" function. Returning 2 errors from a function can be confusing and uncommon in Golang, especially if the function only returns these 2 errors.
The new code will return one error, which is always an APIError, and it also improves the error messaging wording, adding more details in the output.
Several more tweaks can be done to the current error message handling if needed.