handle err

This commit is contained in:
白茶清欢 2023-02-14 22:27:24 +08:00
parent cd667a868d
commit 4da6028308

View File

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