diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-12-22 12:37:52 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-12-22 12:37:52 +0100 |
commit | 6161f47bd82d4db3ff2b10b3a4674d4430693b27 (patch) | |
tree | 81d05f2a69986f00f6c72b51b6b5d66046ad3a39 | |
parent | 6b184e2521dd680efb604efe7c521e0b794f236d (diff) |
disambiguate error scenarios better
-rw-r--r-- | src/backend/taler-merchant-httpd_proposal.c | 15 |
1 files changed, 10 insertions, 5 deletions
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"); } |