We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I had a quick question/feedback - I was wondering if a status code could be included along with the response from the gh.RESTClient().Get?
for example I was making a call
client, err := gh.RESTClient(options) <snip> err = client.Get("enterprises/avocado-corp/audit-log", &response) Unfortunately err cannot be type-casted to api.httperror since api.httperror is not exported, so I’d have to rely on string parsing to figure out the error code here. Alternatively api.httpError could be exported to api.HTTPError , in which case the caller can then typecast the error and get all the relevant bits in the struct and do things like retry on certain statusCodes etc. e.g err = client.Get(blah) if err != nil { httpError := err.(*api.HttpError) if httpError.statusCode == 502 { ...retry }else{ ...do something else } }
or the other option would be to read the statusCode, if it’s set on the response.
Does that make sense?
I started a PR to export api.HttpError here - 6596865
Thanks for reading ❤️ .
The text was updated successfully, but these errors were encountered:
Closed in #6, this will be available in the next release.
Sorry, something went wrong.
No branches or pull requests
I had a quick question/feedback - I was wondering if a status code could be included along with the response from the gh.RESTClient().Get?
for example I was making a call
or the other option would be to read the statusCode, if it’s set on the response.
Does that make sense?
I started a PR to export api.HttpError here - 6596865
Thanks for reading ❤️ .
The text was updated successfully, but these errors were encountered: