gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] 01/02: nicer error messages for /tip-autho


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 01/02: nicer error messages for /tip-authorize
Date: Wed, 31 Jan 2018 19:29:04 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository merchant.

commit 9fe3018e88fa1222d169c0408f5614ab4ce7f72d
Author: Florian Dold <address@hidden>
AuthorDate: Wed Jan 31 19:15:05 2018 +0100

    nicer error messages for /tip-authorize
---
 src/backend/taler-merchant-httpd_tip-authorize.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/backend/taler-merchant-httpd_tip-authorize.c 
b/src/backend/taler-merchant-httpd_tip-authorize.c
index f751883..ea2c706 100644
--- a/src/backend/taler-merchant-httpd_tip-authorize.c
+++ b/src/backend/taler-merchant-httpd_tip-authorize.c
@@ -395,26 +395,31 @@ MH_handler_tip_authorize (struct TMH_RequestHandler *rh,
   if (TALER_EC_NONE != ec)
   {
     unsigned int rc;
+    const char *msg;
 
     switch (ec)
     {
     case TALER_EC_TIP_AUTHORIZE_INSUFFICIENT_FUNDS:
       rc = MHD_HTTP_PRECONDITION_FAILED;
+      msg = "Failed to approve tip: merchant has insufficient tipping funds";
       break;
     case TALER_EC_TIP_AUTHORIZE_RESERVE_EXPIRED:
+      msg = "Failed to approve tip: merchant's tipping reserve expired";
       rc = MHD_HTTP_PRECONDITION_FAILED;
       break;
     case TALER_EC_TIP_AUTHORIZE_RESERVE_UNKNOWN:
+      msg = "Failed to approve tip: merchant's tipping reserve does not exist";
       rc = MHD_HTTP_NOT_FOUND;
       break;
     default:
       rc = MHD_HTTP_INTERNAL_SERVER_ERROR;
+      msg = "Failed to approve tip: internal server error";
       break;
     }
     return TMH_RESPONSE_reply_rc (connection,
                                   rc,
                                   ec,
-                                  "Database error approving tip");
+                                  msg);
   }
 
   /* generate success response */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]