From c239ba6f18ee7d62b249c7204dbe50dab37912b8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 27 Jan 2023 14:10:27 +0100 Subject: address DB failure error handling in KYC check --- src/exchange/taler-exchange-httpd_withdraw.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_withdraw.c') diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c index 05153bfc4..567cad5a9 100644 --- a/src/exchange/taler-exchange-httpd_withdraw.c +++ b/src/exchange/taler-exchange-httpd_withdraw.c @@ -164,13 +164,26 @@ withdraw_transaction (void *cls, { const char *kyc_required; - kyc_required = TALER_KYCLOGIC_kyc_test_required ( + qs = TALER_KYCLOGIC_kyc_test_required ( TALER_KYCLOGIC_KYC_TRIGGER_WITHDRAW, &wc->h_payto, TEH_plugin->select_satisfied_kyc_processes, TEH_plugin->cls, &withdraw_amount_cb, - wc); + wc, + &kyc_required); + if (qs < 0) + { + if (GNUNET_DB_STATUS_HARD_ERROR == qs) + { + GNUNET_break (0); + *mhd_ret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_GENERIC_DB_FETCH_FAILED, + "kyc_test_required"); + } + return qs; + } if (NULL != kyc_required) { /* insert KYC requirement into DB! */ @@ -198,10 +211,13 @@ withdraw_transaction (void *cls, if (0 > qs) { if (GNUNET_DB_STATUS_HARD_ERROR == qs) + { + GNUNET_break (0); *mhd_ret = TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_GENERIC_DB_FETCH_FAILED, "do_withdraw"); + } return qs; } if (! found) -- cgit v1.2.3