handle err
This commit is contained in:
parent
cd667a868d
commit
4da6028308
@ -84,6 +84,10 @@ func (hc *httpClient) Send(requestURL string, method string, header map[string]s
|
|||||||
default:
|
default:
|
||||||
return nil, errors.New(method + " is not invalid")
|
return nil, errors.New(method + " is not invalid")
|
||||||
}
|
}
|
||||||
|
if nil != err {
|
||||||
|
return nil, errors.New(" request send fail : " + err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
if response.StatusCode != http.StatusOK {
|
if response.StatusCode != http.StatusOK {
|
||||||
return nil, fmt.Errorf("%v : %v", response.StatusCode, response.Status)
|
return nil, fmt.Errorf("%v : %v", response.StatusCode, response.Status)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user