commit 156326503d27a66397f9ce7a04bebb925fb34697 parent 575058c3c579548295bf0d325ddfd06e323fe872 Author: Joel-Haeberli <haebu@rubigen.ch> Date: Mon, 3 Jun 2024 18:35:57 +0200 fix: enhance logging Diffstat:
| M | c2ec/wallee-client.go | | | 13 | ++++++------- |
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/c2ec/wallee-client.go b/c2ec/wallee-client.go @@ -179,12 +179,11 @@ func (w *WalleeClient) Refund(transactionId string) error { } withdrawal, err := DB.GetWithdrawalByProviderTransactionId(transactionId) - if err != nil || withdrawal == nil { - if err != nil { - return err - } else { - return errors.New("unable to find withdrawal belonging to transactionId=" + transactionId) - } + if err != nil { + return err + } + if withdrawal == nil { + return errors.New("unable to find withdrawal belonging to transactionId=" + transactionId) } decodedWalleeTransaction, err := NewJsonCodec[WalleeTransaction]().Decode(bytes.NewBuffer(withdrawal.CompletionProof)) @@ -235,7 +234,7 @@ func (w *WalleeClient) Refund(transactionId string) error { return err } if status != HTTP_OK { - return errors.New("no result") + return errors.New("failed refunding the transaction at the wallee-backend. statuscode=" + strconv.Itoa(status)) } return nil }