commit 87082a8dd0a06d45ab5614a574f6c8f567f204ac
parent 1de87fc27f26ce5e1d54526ae66d45f9e35b13ac
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 20 Oct 2016 21:30:40 +0200
return missing error code, use existing function where approprite
Diffstat:
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_pay.c b/src/backend/taler-merchant-httpd_pay.c
@@ -928,9 +928,7 @@ MH_handler_pay (struct TMH_RequestHandler *rh,
if (GNUNET_SYSERR == res)
{
GNUNET_break (0);
- return TMH_RESPONSE_reply_external_error (connection,
- TALER_EC_JSON_INVALID,
- "failed to parse JSON body");
+ return TMH_RESPONSE_reply_invalid_json (connection);
}
if ((GNUNET_NO == res) || (NULL == root))
return MHD_YES; /* the POST's body has to be further fetched */
diff --git a/src/backend/taler-merchant-httpd_responses.c b/src/backend/taler-merchant-httpd_responses.c
@@ -245,7 +245,8 @@ TMH_RESPONSE_reply_invalid_json (struct MHD_Connection *connection)
{
return TMH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
- "{s:s}",
+ "{s:I, s:s}",
+ "code", (json_int_t) TALER_EC_JSON_INVALID,
"error", "invalid json");
}