summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_reserves_get.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-25 15:11:56 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-25 15:11:56 +0200
commit4bba7263564303f45eed86cc68e54bbbf00856a6 (patch)
tree2a9985652bcf85670afc59559e129f639bd69578 /src/exchange/taler-exchange-httpd_reserves_get.c
parentce266ce8f2333d5c30672cf56c3d2e92ef20a851 (diff)
downloadexchange-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.c16
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,