summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-01-16 17:45:05 +0100
committerChristian Grothoff <christian@grothoff.org>2023-01-16 17:45:05 +0100
commitfaf3f57ce3582a5b9f1070d689827bccd0183cd4 (patch)
tree6510265d7e69b1309cac68ba53d57f6d386eaf9e /src/exchange/taler-exchange-httpd_responses.c
parent8563dcc8452d243ec63f98f0b63b48aa82c050a3 (diff)
downloadexchange-faf3f57ce3582a5b9f1070d689827bccd0183cd4.tar.gz
exchange-faf3f57ce3582a5b9f1070d689827bccd0183cd4.tar.bz2
exchange-faf3f57ce3582a5b9f1070d689827bccd0183cd4.zip
do not 500 on empty reserve history by not ignoring undecided purses that may have caused reserve to be created in the first place
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index ab9b81390..33bc13985 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -704,6 +704,7 @@ TEH_RESPONSE_compile_reserve_history (
json_t *json_history;
json_history = json_array ();
+ GNUNET_assert (NULL != json_history);
for (const struct TALER_EXCHANGEDB_ReserveHistory *pos = rh;
NULL != pos;
pos = pos->next)
@@ -1012,10 +1013,14 @@ reply_reserve_insufficient_funds (
json_history = TEH_RESPONSE_compile_reserve_history (rh);
if (NULL == json_history)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to compile reserve history\n");
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_EXCHANGE_RESERVE_HISTORY_ERROR_INSUFFICIENT_FUNDS,
NULL);
+ }
return TALER_MHD_REPLY_JSON_PACK (
connection,
MHD_HTTP_CONFLICT,
@@ -1061,6 +1066,7 @@ TEH_RESPONSE_reply_reserve_insufficient_balance (
if ( (qs < 0) ||
(NULL == rh) )
{
+ GNUNET_break (0);
return TALER_MHD_reply_with_error (connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
TALER_EC_GENERIC_DB_FETCH_FAILED,