Skip to content

Commit

Permalink
chore: log error
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Nov 24, 2023
1 parent 8951fd0 commit 484f7ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions controllers_v2/keysend.ctrl.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func (controller *KeySendController) KeySend(c echo.Context) error {
}
errResp := controller.checkKeysendPaymentAllowed(context.Background(), reqBody.Amount, userID)
if errResp != nil {
c.Logger().Errorf("Failed to send keysend: %s", errResp.Message)
return c.JSON(errResp.HttpStatusCode, errResp)
}
result, errResp := controller.SingleKeySend(c.Request().Context(), &reqBody, userID)
Expand Down Expand Up @@ -128,6 +129,7 @@ func (controller *KeySendController) MultiKeySend(c echo.Context) error {
}
errResp := controller.checkKeysendPaymentAllowed(context.Background(), totalAmount, userID)
if errResp != nil {
c.Logger().Errorf("Failed to making keysend split payment: %s", errResp.Message)
return c.JSON(errResp.HttpStatusCode, errResp)
}
result := &MultiKeySendResponseBody{
Expand Down Expand Up @@ -173,9 +175,8 @@ func (controller *KeySendController) checkKeysendPaymentAllowed(ctx context.Cont
return resp
}
if err != nil {
errResp := responses.GeneralServerError
controller.svc.Logger.Errorf("Failed to send keysend: %s", errResp.Message)
return &errResp
controller.svc.Logger.Error(err)
return &responses.GeneralServerError
}
return nil
}
Expand Down

0 comments on commit 484f7ab

Please sign in to comment.