1
0
Fork 0
mirror of https://git.sr.ht/~adnano/go-gemini synced 2024-05-14 08:16:04 +02:00

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:
Adnan Maolood 2021-02-15 19:18:21 -05:00
parent 19678ef934
commit bf4959a8ba

View File

@ -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