mirror of
https://github.com/christianselig/apollo-backend
synced 2024-12-25 15:55:28 +00:00
don't be clever with server errors
This commit is contained in:
parent
b9e6950cb1
commit
203b6600d5
1 changed files with 1 additions and 10 deletions
|
@ -123,16 +123,7 @@ func (rac *AuthenticatedClient) request(r *Request, rh ResponseHandler, empty in
|
|||
|
||||
if resp.StatusCode != 200 {
|
||||
_ = rac.statsd.Incr("reddit.api.errors", r.tags, 0.1)
|
||||
|
||||
// Try to parse a json error. Otherwise we generate a generic one
|
||||
parser := rac.pool.Get()
|
||||
defer rac.pool.Put(parser)
|
||||
|
||||
val, jerr := parser.ParseBytes(bb)
|
||||
if jerr != nil {
|
||||
return nil, ServerError{resp.StatusCode}
|
||||
}
|
||||
return nil, NewError(val, resp.StatusCode)
|
||||
return nil, ServerError{resp.StatusCode}
|
||||
}
|
||||
|
||||
if r.emptyResponseBytes > 0 && len(bb) == r.emptyResponseBytes {
|
||||
|
|
Loading…
Reference in a new issue