summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_withdraw.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-27 14:10:27 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-27 14:10:40 +0100
commitc239ba6f18ee7d62b249c7204dbe50dab37912b8 (patch)
tree27ccb16a15da81900d5a622417b95c5c172d9dc6 /src/exchange/taler-exchange-httpd_withdraw.c
parent7e8e2f43178139b35f726dd0584ef629e1853af8 (diff)
downloadexchange-c239ba6f18ee7d62b249c7204dbe50dab37912b8.tar.gz
exchange-c239ba6f18ee7d62b249c7204dbe50dab37912b8.tar.bz2
exchange-c239ba6f18ee7d62b249c7204dbe50dab37912b8.zip
address DB failure error handling in KYC check
Diffstat (limited to 'src/exchange/taler-exchange-httpd_withdraw.c')
-rw-r--r--src/exchange/taler-exchange-httpd_withdraw.c20
1 files changed, 18 insertions, 2 deletions
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)