summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-05-22 12:42:02 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-05-22 12:42:02 +0200
commitb84ba7074b1dfe92781690d75d338b65cd1e6902 (patch)
tree6ba9ae2ddea67454638a83fb42192f30812d450a /src
parentce55e7c229bcb251fe95cd0779148d7c261bb3ab (diff)
downloadexchange-b84ba7074b1dfe92781690d75d338b65cd1e6902.tar.gz
exchange-b84ba7074b1dfe92781690d75d338b65cd1e6902.tar.bz2
exchange-b84ba7074b1dfe92781690d75d338b65cd1e6902.zip
New error code for a unknown reserve public key.
Specific to the /reserve/status API.
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_reserve_status.c5
-rw-r--r--src/include/taler_error_codes.h6
-rw-r--r--src/json/json.c2
3 files changed, 9 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_reserve_status.c b/src/exchange/taler-exchange-httpd_reserve_status.c
index 998460da7..6ff73de75 100644
--- a/src/exchange/taler-exchange-httpd_reserve_status.c
+++ b/src/exchange/taler-exchange-httpd_reserve_status.c
@@ -154,9 +154,10 @@ TEH_RESERVE_handler_reserve_status (struct TEH_RequestHandler *rh,
if (NULL == rsc.rh)
return TEH_RESPONSE_reply_json_pack (connection,
MHD_HTTP_NOT_FOUND,
- "{s:s, s:s}",
+ "{s:s, s:s, s:I}",
"error", "Reserve not found",
- "parameter", "withdraw_pub");
+ "parameter", "withdraw_pub",
+ "code", (json_int_t) TALER_EC_RESERVE_STATUS_UNKNOWN);
mhd_ret = reply_reserve_status_success (connection,
rsc.rh);
TEH_plugin->free_reserve_history (TEH_plugin->cls,
diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h
index 8f082ecd8..754681b41 100644
--- a/src/include/taler_error_codes.h
+++ b/src/include/taler_error_codes.h
@@ -299,6 +299,12 @@ enum TALER_ErrorCode
*/
TALER_EC_RESERVE_STATUS_DB_ERROR = 1150,
+ /**
+ * The reserve status was requested using a unknown key,
+ * to be returned with 404 Not Found.
+ */
+ TALER_EC_RESERVE_STATUS_UNKNOWN = 1151,
+
/**
* The respective coin did not have sufficient residual value
diff --git a/src/json/json.c b/src/json/json.c
index adcc2314a..700b58a5a 100644
--- a/src/json/json.c
+++ b/src/json/json.c
@@ -80,6 +80,4 @@ TALER_JSON_get_error_code (const json_t *json)
return TALER_EC_INVALID;
}
-
-
/* End of json/json.c */