commit 36e209852b69309d53c2dd3620b04a020ea939b5
parent 8a21efcf033de41a161176444b0925dd4b8d885d
Author: Joel-Haeberli <haebu@rubigen.ch>
Date: Mon, 3 Jun 2024 12:40:04 +0200
fix: enhance logging
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/c2ec/api-wire-gateway.go b/c2ec/api-wire-gateway.go
@@ -206,6 +206,7 @@ func transfer(res http.ResponseWriter, req *http.Request) {
// no transfer for this request_id -> generate new
amount, err := ParseAmount(transfer.Amount, CONFIG.Server.CurrencyFractionDigits)
if err != nil {
+ LogWarn("wire-gateway-api", "failed parsing amount")
LogError("wire-gateway-api", err)
setLastResponseCodeForLogger(HTTP_INTERNAL_SERVER_ERROR)
res.WriteHeader(HTTP_INTERNAL_SERVER_ERROR)
@@ -219,6 +220,7 @@ func transfer(res http.ResponseWriter, req *http.Request) {
transfer.CreditAccount,
)
if err != nil {
+ LogWarn("wire-gateway-api", "failed adding new transfer entry to database")
LogError("wire-gateway-api", err)
setLastResponseCodeForLogger(HTTP_INTERNAL_SERVER_ERROR)
res.WriteHeader(HTTP_INTERNAL_SERVER_ERROR)
@@ -246,6 +248,7 @@ func transfer(res http.ResponseWriter, req *http.Request) {
w, err := DB.GetWithdrawalByProviderTransactionId(tid)
if err != nil || w == nil {
+ LogWarn("wire-gateway-api", "unable to find withdrawal with given provider transaction id")
LogError("wire-gateway-api", err)
setLastResponseCodeForLogger(HTTP_INTERNAL_SERVER_ERROR)
res.WriteHeader(HTTP_INTERNAL_SERVER_ERROR)