diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-08-25 15:11:56 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-08-25 15:11:56 +0200 |
commit | 4bba7263564303f45eed86cc68e54bbbf00856a6 (patch) | |
tree | 2a9985652bcf85670afc59559e129f639bd69578 /src/exchange/taler-exchange-httpd_reserves_get.c | |
parent | ce266ce8f2333d5c30672cf56c3d2e92ef20a851 (diff) | |
download | exchange-4bba7263564303f45eed86cc68e54bbbf00856a6.tar.gz exchange-4bba7263564303f45eed86cc68e54bbbf00856a6.tar.bz2 exchange-4bba7263564303f45eed86cc68e54bbbf00856a6.zip |
nicer generic error reporting logic, for #6432
Diffstat (limited to 'src/exchange/taler-exchange-httpd_reserves_get.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_reserves_get.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserves_get.c b/src/exchange/taler-exchange-httpd_reserves_get.c index cbc6b422b..2272e6d03 100644 --- a/src/exchange/taler-exchange-httpd_reserves_get.c +++ b/src/exchange/taler-exchange-httpd_reserves_get.c @@ -51,7 +51,7 @@ reply_reserve_history_success (struct MHD_Connection *connection, return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, TALER_EC_RESERVE_STATUS_DB_ERROR, - "balance calculation failure"); + NULL); json_balance = TALER_JSON_from_amount (&balance); return TALER_MHD_reply_json_pack (connection, MHD_HTTP_OK, @@ -143,7 +143,7 @@ TEH_handler_reserves_get (const struct TEH_RequestHandler *rh, return TALER_MHD_reply_with_error (connection, MHD_HTTP_BAD_REQUEST, TALER_EC_RESERVES_INVALID_RESERVE_PUB, - "reserve public key malformed"); + args[0]); } rsc.rh = NULL; if (GNUNET_OK != @@ -156,14 +156,10 @@ TEH_handler_reserves_get (const struct TEH_RequestHandler *rh, /* generate proper response */ if (NULL == rsc.rh) - return TALER_MHD_reply_json_pack (connection, - MHD_HTTP_NOT_FOUND, - "{s:s, s:s, s:I}", - "hint", "Reserve not found", - "parameter", "reserve_pub", - "code", - (json_int_t) - TALER_EC_RESERVE_STATUS_UNKNOWN); + return TALER_MHD_reply_with_error (connection, + MHD_HTTP_NOT_FOUND, + TALER_EC_RESERVE_STATUS_UNKNOWN, + args[0]); mhd_ret = reply_reserve_history_success (connection, rsc.rh); TEH_plugin->free_reserve_history (TEH_plugin->cls, |