maxapi: fix dump request error check

This commit is contained in:
c9s 2021-06-09 02:18:37 +08:00
parent 48c84824cf
commit 16e5e08d58

View File

@ -269,12 +269,12 @@ func (c *RestClient) newAuthenticatedRequest(m string, refURL string, data inter
req.Header.Add("X-MAX-SIGNATURE", signPayload(encoded, c.APISecret))
if debugRequestDump {
dump, err := httputil.DumpRequestOut(req, true)
if err != nil {
log.Panic(err)
dump, err2 := httputil.DumpRequestOut(req, true)
if err2 != nil {
log.Errorf("dump request error: %v", err2)
} else {
fmt.Printf("REQUEST:\n%s", dump)
}
fmt.Printf("REQUEST:\n%s", dump)
}
return req, nil