From 3cb41cb650c7cea61e2a2e846a716e98fc1fac12 Mon Sep 17 00:00:00 2001 From: Sinh Date: Mon, 16 Dec 2024 15:54:53 +0700 Subject: [PATCH] chore: onpoint - add more info to the error --- partnerapi/onpoint/onpoint.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partnerapi/onpoint/onpoint.go b/partnerapi/onpoint/onpoint.go index a05a079..1f99b80 100644 --- a/partnerapi/onpoint/onpoint.go +++ b/partnerapi/onpoint/onpoint.go @@ -66,12 +66,12 @@ func (c *Client) CreateOrder(p CreateOrderRequest) (*CreateOrderResponse, error) } if res.StatusCode >= http.StatusBadRequest { 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 } 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