summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_parsing.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-10-18 23:05:29 +0200
committerChristian Grothoff <christian@grothoff.org>2016-10-18 23:05:29 +0200
commit70462f0b94d933bec7b735fecb66a75a45c91c66 (patch)
tree8f37b8b01ce130fb7cb11b192d422a4ce7793a50 /src/exchange/taler-exchange-httpd_parsing.c
parentaa3332b74e18d27cf26864f69c6b17c4d98ff14f (diff)
downloadexchange-70462f0b94d933bec7b735fecb66a75a45c91c66.tar.gz
exchange-70462f0b94d933bec7b735fecb66a75a45c91c66.tar.bz2
exchange-70462f0b94d933bec7b735fecb66a75a45c91c66.zip
implement #4497/#4705 -- addition of unique numeric error codes -- for the server-side of the exchange
Diffstat (limited to 'src/exchange/taler-exchange-httpd_parsing.c')
-rw-r--r--src/exchange/taler-exchange-httpd_parsing.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/exchange/taler-exchange-httpd_parsing.c b/src/exchange/taler-exchange-httpd_parsing.c
index c7118c462..e9c38eb82 100644
--- a/src/exchange/taler-exchange-httpd_parsing.c
+++ b/src/exchange/taler-exchange-httpd_parsing.c
@@ -79,6 +79,7 @@ TEH_PARSE_post_json (struct MHD_Connection *connection,
case GNUNET_JSON_PR_OUT_OF_MEMORY:
return (MHD_NO ==
TEH_RESPONSE_reply_internal_error (connection,
+ TALER_EC_PARSER_OUT_OF_MEMORY,
"out of memory"))
? GNUNET_SYSERR : GNUNET_NO;
case GNUNET_JSON_PR_CONTINUE:
@@ -144,7 +145,9 @@ TEH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
if (NULL == str)
{
return (MHD_NO ==
- TEH_RESPONSE_reply_arg_missing (connection, param_name))
+ TEH_RESPONSE_reply_arg_missing (connection,
+ TALER_EC_PARAMETER_MISSING,
+ param_name))
? GNUNET_SYSERR : GNUNET_NO;
}
if (GNUNET_OK !=
@@ -153,7 +156,9 @@ TEH_PARSE_mhd_request_arg_data (struct MHD_Connection *connection,
out_data,
out_size))
return (MHD_NO ==
- TEH_RESPONSE_reply_arg_invalid (connection, param_name))
+ TEH_RESPONSE_reply_arg_invalid (connection,
+ TALER_EC_PARAMETER_MALFORMED,
+ param_name))
? GNUNET_SYSERR : GNUNET_NO;
return GNUNET_OK;
}
@@ -193,8 +198,9 @@ TEH_PARSE_json_data (struct MHD_Connection *connection,
ret = (MHD_YES ==
TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_BAD_REQUEST,
- "{s:s, s:s, s:I}",
+ "{s:s, s:I, s:s, s:I}",
"error", "parse error",
+ "code", (json_int_t) TALER_EC_JSON_INVALID_WITH_DETAILS,
"field", error_json_name,
"line", (json_int_t) error_line))
? GNUNET_NO : GNUNET_SYSERR;