handle err

This commit is contained in:
白茶清欢 2023-02-14 22:27:24 +08:00
parent cd667a868d
commit 4da6028308
1 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,10 @@ func (hc *httpClient) Send(requestURL string, method string, header map[string]s
default:
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 {
return nil, fmt.Errorf("%v : %v", response.StatusCode, response.Status)
}