chore: onpoint - add more info to the error #21
|
@ -66,12 +66,12 @@ func (c *Client) CreateOrder(p CreateOrderRequest) (*CreateOrderResponse, error)
|
||||||
}
|
}
|
||||||
if res.StatusCode >= http.StatusBadRequest {
|
if res.StatusCode >= http.StatusBadRequest {
|
||||||
if err := r.ParseResponseData(&errRes); err != nil {
|
if err := r.ParseResponseData(&errRes); err != nil {
|
||||||
return nil, fmt.Errorf("onpoint.Client.CreateOrder: parse_response_err: %v", err)
|
return nil, fmt.Errorf("onpoint.Client.CreateOrder: parse_response_err: %v. Reason: %s", err, res.Body)
|
||||||
}
|
}
|
||||||
return nil, errRes
|
return nil, errRes
|
||||||
}
|
}
|
||||||
if err := r.ParseResponseData(&dataRes); err != nil {
|
if err := r.ParseResponseData(&dataRes); err != nil {
|
||||||
return nil, fmt.Errorf("onpoint.Client.CreateOrder: parse_response_data: %v", err)
|
return nil, fmt.Errorf("onpoint.Client.CreateOrder: parse_response_data: %v. Raw response: %s", err, res.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &dataRes.Data, nil
|
return &dataRes.Data, nil
|
||||||
|
|
Loading…
Reference in New Issue