From e8a88392da98c3325ba39b20901a5c220158d1f5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 23 Nov 2019 18:47:07 +0100 Subject: more refactoring towards using libtalermhd --- src/exchange/taler-exchange-httpd_responses.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_responses.c') 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); } -- cgit v1.2.3