merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 6161f47bd82d4db3ff2b10b3a4674d4430693b27
parent 6b184e2521dd680efb604efe7c521e0b794f236d
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 22 Dec 2018 12:37:52 +0100

disambiguate error scenarios better

Diffstat:
Msrc/backend/taler-merchant-httpd_proposal.c | 15++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c @@ -436,15 +436,20 @@ proposal_put (struct MHD_Connection *connection, } if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != qs) { - if ( (GNUNET_DB_STATUS_SOFT_ERROR == qs) || - (GNUNET_DB_STATUS_HARD_ERROR == qs) ) + if (GNUNET_DB_STATUS_HARD_ERROR == qs) { return TMH_RESPONSE_reply_internal_error (connection, - TALER_EC_PROPOSAL_STORE_DB_ERROR, - "db error: could not check for existing order"); + TALER_EC_PROPOSAL_STORE_DB_ERROR_HARD, + "db error: could not check for existing order due to hard transaction failure"); + } + if (GNUNET_DB_STATUS_SOFT_ERROR == qs) + { + return TMH_RESPONSE_reply_internal_error (connection, + TALER_EC_PROPOSAL_STORE_DB_ERROR_SOFT, + "db error: could not check for existing order due to soft transaction failure (FIXME: should implement retry logic)"); } return TMH_RESPONSE_reply_external_error (connection, - TALER_EC_PROPOSAL_STORE_DB_ERROR, + TALER_EC_PROPOSAL_STORE_DB_ERROR_ALREADY_EXISTS, "proposal already exists"); }