gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: log exchange status code if oper


From: gnunet
Subject: [taler-merchant] branch master updated: log exchange status code if operation fails with bad gateway
Date: Wed, 26 May 2021 09:40:01 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 3c01b3c1 log exchange status code if operation fails with bad gateway
3c01b3c1 is described below

commit 3c01b3c1d930b61b87053f623beff982042d0ad5
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed May 26 09:39:59 2021 +0200

    log exchange status code if operation fails with bad gateway
---
 src/lib/merchant_api_post_transfers.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/src/lib/merchant_api_post_transfers.c 
b/src/lib/merchant_api_post_transfers.c
index 3a775b90..2e41ebb2 100644
--- a/src/lib/merchant_api_post_transfers.c
+++ b/src/lib/merchant_api_post_transfers.c
@@ -209,6 +209,39 @@ handle_post_transfers_finished (void *cls,
     hr.ec = TALER_JSON_get_error_code (json);
     hr.hint = TALER_JSON_get_error_hint (json);
     break;
+  case MHD_HTTP_BAD_GATEWAY:
+    /* Exchange had an issue; we should retry, but this API
+       leaves this to the application */
+    hr.ec = TALER_JSON_get_error_code (json);
+    hr.hint = TALER_JSON_get_error_hint (json);
+    {
+      uint32_t eec;
+      uint32_t ehc;
+      struct GNUNET_JSON_Specification ispec[] = {
+        GNUNET_JSON_spec_uint32 ("exchange_code",
+                                 &eec),
+        GNUNET_JSON_spec_uint32 ("exchange_http_status",
+                                 &ehc),
+        GNUNET_JSON_spec_end ()
+      };
+
+      if (GNUNET_OK !=
+          GNUNET_JSON_parse (deposit_sum,
+                             ispec,
+                             NULL, NULL))
+      {
+        GNUNET_break_op (0);
+        break;
+      }
+      else
+      {
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                    "Exchange returned %u/%u\n",
+                    (unsigned int) eec,
+                    (unsigned int) ehc);
+      }
+    }
+    break;
   case MHD_HTTP_GATEWAY_TIMEOUT:
     /* Server had an internal issue; we should retry, but this API
        leaves this to the application */

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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