exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 4049e38d5cdc80970848a751283e2698c3bf2346
parent 8cc52ed1dce4be855194db8303fe7cfb472bae3b
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  3 Apr 2026 18:00:10 +0200

nicer handling of some cases

Diffstat:
Msrc/lib/exchange_api_post-kyc-start-ID.c | 14++++++++++++++
Msrc/lib/exchange_api_post-management-global-fees.c | 17+----------------
Msrc/lib/exchange_api_post-withdraw_blinded.c | 4++--
3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/lib/exchange_api_post-kyc-start-ID.c b/src/lib/exchange_api_post-kyc-start-ID.c @@ -125,7 +125,21 @@ handle_kyc_start_finished (void *cls, } } break; + case MHD_HTTP_BAD_REQUEST: + adr.hr.ec = TALER_JSON_get_error_code (json); + adr.hr.hint = TALER_JSON_get_error_hint (json); + break; case MHD_HTTP_NOT_FOUND: + adr.hr.ec = TALER_JSON_get_error_code (json); + adr.hr.hint = TALER_JSON_get_error_hint (json); + break; + case MHD_HTTP_CONFLICT: + adr.hr.ec = TALER_JSON_get_error_code (json); + adr.hr.hint = TALER_JSON_get_error_hint (json); + break; + case MHD_HTTP_INTERNAL_SERVER_ERROR: + adr.hr.ec = TALER_JSON_get_error_code (json); + adr.hr.hint = TALER_JSON_get_error_hint (json); break; default: /* unexpected response code */ diff --git a/src/lib/exchange_api_post-management-global-fees.c b/src/lib/exchange_api_post-management-global-fees.c @@ -135,26 +135,11 @@ handle_global_fees_finished (void *cls, res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; - case MHD_HTTP_NOT_FOUND: - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Server did not find handler at `%s'. Did you configure the correct exchange base URL?\n", - pmgfh->url); - if (NULL != json) - { - res.hr.ec = TALER_JSON_get_error_code (json); - res.hr.hint = TALER_JSON_get_error_hint (json); - } - else - { - res.hr.ec = TALER_EC_GENERIC_INVALID_RESPONSE; - res.hr.hint = TALER_ErrorCode_get_hint (res.hr.ec); - } - break; case MHD_HTTP_CONFLICT: res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; - case MHD_HTTP_PRECONDITION_FAILED: + case MHD_HTTP_REQUEST_ENTITY_TOO_LARGE: res.hr.ec = TALER_JSON_get_error_code (json); res.hr.hint = TALER_JSON_get_error_hint (json); break; diff --git a/src/lib/exchange_api_post-withdraw_blinded.c b/src/lib/exchange_api_post-withdraw_blinded.c @@ -714,8 +714,8 @@ TALER_EXCHANGE_post_withdraw_blinded_start ( j_planchets), GNUNET_JSON_pack_allow_null ( pwbh->with_age_proof - ? GNUNET_JSON_pack_int64 ("max_age", - pwbh->max_age) + ? GNUNET_JSON_pack_uint64 ("max_age", + pwbh->max_age) : GNUNET_JSON_pack_string ("max_age", NULL) ), GNUNET_JSON_pack_data_auto ("reserve_sig",