fix: remove panic

This commit is contained in:
RXDA
2022-05-12 11:41:46 +08:00
parent 98b67571a5
commit 07d8f25bf7

2
sdk.go
View File

@@ -103,7 +103,7 @@ func (hk HKConfig) HttpPost(url string, body map[string]string, timeout int) (re
err = json.Unmarshal(resBody, &result)
} else if resp.StatusCode == http.StatusFound || resp.StatusCode == http.StatusMovedPermanently {
reqUrl := resp.Header.Get("Location")
panic(fmt.Errorf("HttpPost Response StatusCode%dLocation%s", resp.StatusCode, reqUrl))
err = fmt.Errorf("HttpPost Response StatusCode%dLocation%s", resp.StatusCode, reqUrl)
} else {
err = fmt.Errorf("HttpPost Response StatusCode%d", resp.StatusCode)
}