From 6161f47bd82d4db3ff2b10b3a4674d4430693b27 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 22 Dec 2018 12:37:52 +0100 Subject: disambiguate error scenarios better --- src/backend/taler-merchant-httpd_proposal.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/backend/taler-merchant-httpd_proposal.c b/src/backend/taler-merchant-httpd_proposal.c index 1cdea4a6..6d934c98 100644 --- 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"); } -- cgit v1.2.3