diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-05-26 09:39:59 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-05-26 09:39:59 +0200 |
commit | 3c01b3c1d930b61b87053f623beff982042d0ad5 (patch) | |
tree | 6bf06cfbbc0d588e76420bc97dd89c68aa3c5b90 /src/lib | |
parent | 5e1d3d01a3fdbff3d8583c6d3281bdd7171af1d2 (diff) | |
download | merchant-3c01b3c1d930b61b87053f623beff982042d0ad5.tar.gz merchant-3c01b3c1d930b61b87053f623beff982042d0ad5.tar.bz2 merchant-3c01b3c1d930b61b87053f623beff982042d0ad5.zip |
log exchange status code if operation fails with bad gateway
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/merchant_api_post_transfers.c | 33 |
1 files changed, 33 insertions, 0 deletions
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 */ |