Return ErrInvalidResponse on error reading status
Return ErrInvalidResponse when unable to read the response status code instead of returning the error from strconv.
This commit is contained in:
parent
19678ef934
commit
bf4959a8ba
@ -51,7 +51,7 @@ func ReadResponse(rc io.ReadCloser) (*Response, error) {
|
||||
}
|
||||
status, err := strconv.Atoi(string(statusB))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, ErrInvalidResponse
|
||||
}
|
||||
resp.Status = status
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user