diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-01-27 14:19:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-01-27 14:19:14 +0100 |
commit | 42bd2dadcfad336623c0650c28580e8206bf95b9 (patch) | |
tree | 947a8777e0bc5651fe46c72736838ea43d781be9 /src/exchange/taler-exchange-httpd_kyc-check.c | |
parent | c239ba6f18ee7d62b249c7204dbe50dab37912b8 (diff) |
address DB failure error handling in KYC check
Diffstat (limited to 'src/exchange/taler-exchange-httpd_kyc-check.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_kyc-check.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/src/exchange/taler-exchange-httpd_kyc-check.c b/src/exchange/taler-exchange-httpd_kyc-check.c index 47338ae9..1ef12bd9 100644 --- a/src/exchange/taler-exchange-httpd_kyc-check.c +++ b/src/exchange/taler-exchange-httpd_kyc-check.c @@ -297,6 +297,7 @@ kyc_check (void *cls, enum GNUNET_GenericReturnValue ret; struct TALER_PaytoHashP h_payto; char *requirements; + bool satisfied; qs = TEH_plugin->lookup_kyc_requirement_by_row ( TEH_plugin->cls, @@ -330,12 +331,26 @@ kyc_check (void *cls, GNUNET_free (requirements); return GNUNET_DB_STATUS_HARD_ERROR; } - if (TALER_KYCLOGIC_check_satisfied ( - requirements, - &h_payto, - &kyp->kyc_details, - TEH_plugin->select_satisfied_kyc_processes, - TEH_plugin->cls)) + qs = TALER_KYCLOGIC_check_satisfied ( + requirements, + &h_payto, + &kyp->kyc_details, + TEH_plugin->select_satisfied_kyc_processes, + TEH_plugin->cls, + &satisfied); + if (qs < 0) + { + if (GNUNET_DB_STATUS_SOFT_ERROR == qs) + return 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"); + GNUNET_free (requirements); + return GNUNET_DB_STATUS_HARD_ERROR; + } + if (satisfied) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "KYC requirements `%s' already satisfied\n", |