parent
ac333d9d47
commit
5712aafba9
@ -98,10 +98,12 @@ func newWatcher(req *api.Request) (Watcher, error) {
|
||||
// do the raw request
|
||||
res, err := req.Raw()
|
||||
if err != nil {
|
||||
cancel()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if res.StatusCode < 200 || res.StatusCode >= 300 {
|
||||
cancel()
|
||||
// close the response body
|
||||
res.Body.Close()
|
||||
// return an error
|
||||
|
Loading…
Reference in New Issue
Block a user