diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-11-01 15:36:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-11-01 15:36:14 +0100 |
commit | 375a47d5023c9eccf45d8142a0568824eb4ed7ab (patch) | |
tree | dab8a343adfd77a8ddcc6a579cecbe918cba095a /src/exchange/taler-exchange-httpd_responses.c | |
parent | 40d9674856dd77a98053f0451d76791de146551f (diff) | |
download | exchange-375a47d5023c9eccf45d8142a0568824eb4ed7ab.tar.gz exchange-375a47d5023c9eccf45d8142a0568824eb4ed7ab.tar.bz2 exchange-375a47d5023c9eccf45d8142a0568824eb4ed7ab.zip |
improve status codes returned in case of denomination key troubles
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_responses.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index 2e1835845..048a8bef0 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -362,6 +362,26 @@ TEH_RESPONSE_reply_internal_error (struct MHD_Connection *connection, /** + * Send a response indicating an error. + * + * @param connection the MHD connection to use + * @param ec error code uniquely identifying the error + * @param http_status HTTP status code to use + * @return a MHD result code + */ +int +TEH_RESPONSE_reply_with_error (struct MHD_Connection *connection, + enum TALER_ErrorCode ec, + unsigned int http_status) +{ + return TEH_RESPONSE_reply_json_pack (connection, + http_status, + "{s:I}", + "code", (json_int_t) ec); +} + + +/** * Send a response indicating an external error. * * @param connection the MHD connection to use |