diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-11-29 10:52:45 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-11-29 10:52:45 +0100 |
commit | 636488c2797b498c8861bc6864539a63323b3608 (patch) | |
tree | 11b0f04aa31c40a0736babf5ee0a4d0d29682a32 /src/auditor/taler-auditor-httpd_db.c | |
parent | 970e3fd4cb4a3f76d1bcf56e4cec668bcb828078 (diff) | |
parent | 785f5fb7dd5f8e4aa0258e3e72f519c77942cb7d (diff) |
merge error codes
Diffstat (limited to 'src/auditor/taler-auditor-httpd_db.c')
-rw-r--r-- | src/auditor/taler-auditor-httpd_db.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/auditor/taler-auditor-httpd_db.c b/src/auditor/taler-auditor-httpd_db.c index e0ab8f2e1..3433e9a9f 100644 --- a/src/auditor/taler-auditor-httpd_db.c +++ b/src/auditor/taler-auditor-httpd_db.c @@ -23,8 +23,9 @@ #include <jansson.h> #include <gnunet/gnunet_json_lib.h> #include "taler_json_lib.h" +#include "taler_mhd_lib.h" #include "taler-auditor-httpd_db.h" -#include "taler-auditor-httpd_responses.h" +#include "taler-auditor-httpd.h" /** @@ -63,8 +64,10 @@ TAH_DB_run_transaction (struct MHD_Connection *connection, { GNUNET_break (0); if (NULL != mhd_ret) - *mhd_ret = TAH_RESPONSE_reply_internal_db_error (connection, - TALER_EC_DB_SETUP_FAILED); + *mhd_ret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_DB_SETUP_FAILED, + "failed to establish session with database"); return GNUNET_SYSERR; } // TAH_plugin->preflight (TAH_plugin->cls, session); // FIXME: needed? @@ -79,8 +82,10 @@ TAH_DB_run_transaction (struct MHD_Connection *connection, { GNUNET_break (0); if (NULL != mhd_ret) - *mhd_ret = TAH_RESPONSE_reply_internal_db_error (connection, - TALER_EC_DB_START_FAILED); + *mhd_ret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_DB_START_FAILED, + "failed to begin transaction"); return GNUNET_SYSERR; } qs = cb (cb_cls, @@ -98,8 +103,10 @@ TAH_DB_run_transaction (struct MHD_Connection *connection, if (GNUNET_DB_STATUS_HARD_ERROR == qs) { if (NULL != mhd_ret) - *mhd_ret = TAH_RESPONSE_reply_commit_error (connection, - TALER_EC_DB_COMMIT_FAILED_HARD); + *mhd_ret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_DB_COMMIT_FAILED_HARD, + "failed to commit transaction"); return GNUNET_SYSERR; } /* make sure callback did not violate invariants! */ @@ -112,8 +119,10 @@ TAH_DB_run_transaction (struct MHD_Connection *connection, name, MAX_TRANSACTION_COMMIT_RETRIES); if (NULL != mhd_ret) - *mhd_ret = TAH_RESPONSE_reply_commit_error (connection, - TALER_EC_DB_COMMIT_FAILED_ON_RETRY); + *mhd_ret = TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_DB_COMMIT_FAILED_ON_RETRY, + "transaction repeatedly failed to serialize"); return GNUNET_SYSERR; } |