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