Standardise the error return from http request #333
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Issues that anyone could pick up and implement if useful to them
Is your feature request related to a problem? Please describe.
Hey there. I want this because I need to do a error handling of the gql request. Situations like, if the request is returning 429 error, the program should do a retry, etc. However the current code is returning
fmt.Errorf("returned error %v: %s", httpResp.Status, respBody)
. It is not helping the situation. It makes error handling complicated. Can we return the standard error so that can help the user better handling the errors?Describe the solution you'd like
We can do a simple enum. Or we can create a new error object includes the http status code + error info (that includes the resp body).
It will be really nice if we can have such feature. Otherwise I will just fork the code and create my derivatives. Thanks.
The text was updated successfully, but these errors were encountered: