diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-11-23 18:47:07 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-11-23 18:47:07 +0100 |
commit | e8a88392da98c3325ba39b20901a5c220158d1f5 (patch) | |
tree | b2e43949d8ec80d0a24a256479a67547e4a3730f /src/exchange/taler-exchange-httpd_responses.c | |
parent | 8bca461ea9f604e4bce279255663f207f0d104ac (diff) | |
download | exchange-e8a88392da98c3325ba39b20901a5c220158d1f5.tar.gz exchange-e8a88392da98c3325ba39b20901a5c220158d1f5.tar.bz2 exchange-e8a88392da98c3325ba39b20901a5c220158d1f5.zip |
more refactoring towards using libtalermhd
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_responses.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index 048a8bef0..f051cd2e5 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -27,6 +27,7 @@ #include "taler-exchange-httpd_responses.h" #include "taler_util.h" #include "taler_json_lib.h" +#include "taler_mhd_lib.h" #include "taler-exchange-httpd_keystate.h" /** @@ -874,15 +875,16 @@ TEH_RESPONSE_reply_coin_insufficient_funds (struct MHD_Connection *connection, history = TEH_RESPONSE_compile_transaction_history (tl); if (NULL == history) - return TEH_RESPONSE_reply_internal_error (connection, - TALER_EC_COIN_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS, - "failed to convert transaction history to JSON"); - return TEH_RESPONSE_reply_json_pack (connection, - MHD_HTTP_FORBIDDEN, - "{s:s, s:I, s:o}", - "error", "insufficient funds", - "code", (json_int_t) ec, - "history", history); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_INTERNAL_SERVER_ERROR, + TALER_EC_COIN_HISTORY_DB_ERROR_INSUFFICIENT_FUNDS, + "failed to convert transaction history to JSON"); + return TALER_MHD_reply_json_pack (connection, + MHD_HTTP_FORBIDDEN, + "{s:s, s:I, s:o}", + "error", "insufficient funds", + "code", (json_int_t) ec, + "history", history); } |