Skip to content

Commit

Permalink
Make error response more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
AustEcon committed Oct 11, 2022
1 parent f0b9d4a commit 4b9f7b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion transports/http/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ func (h *paymentHandler) createPayment(e echo.Context) error {
return errors.WithStack(err)
}
if resp.Error > 0 {
return e.JSON(http.StatusUnprocessableEntity, resp)
if &resp.Memo != nil {
return e.JSON(http.StatusUnprocessableEntity, resp.Memo)
}
return e.JSON(http.StatusUnprocessableEntity, "")
}
return e.JSON(http.StatusCreated, resp)
}

0 comments on commit 4b9f7b0

Please sign in to comment.