-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
add StatusError to api package #11054
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.
Thank you for working on this!
I haven't had a chance to look at the diff yet, but left a response to your question below.
@ShimmerGlass thanks for your work in #8816 ; i followed up on @dnephin's feedback w this PR. Feel free to comment / add any input here but no pressure ! |
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.
minor nit-picky comments but otherwise looks great!
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.
Nice! LGTM
I left a couple comments about some possible stylistic changes, but nothing that should block a merge
Signed-off-by: FFMMM <FFMMM@users.noreply.github.com>
🍒 If backport labels were added before merging, cherry-picking will start automatically. To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/450932. |
Overview
This PR adds a
StatusError
struct to theapi
package. Now devs can unwrap the errors returned thruquery()
orwrite()
funcs and inspect the error code programatically.Issue Related
#10865
Notes:
requireHttpCodes
method to mark acceptable codes (200, 429, etc)doRequest()
calls can be added in a subsequent PRPR Checklist
[x]
go fmt
[x]
go mod
[x] n/a pr/changelog -- no "public" api changes