summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_responses.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_responses.c')
-rw-r--r--src/exchange/taler-exchange-httpd_responses.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c
index 2e1835845..048a8bef0 100644
--- a/src/exchange/taler-exchange-httpd_responses.c
+++ b/src/exchange/taler-exchange-httpd_responses.c
@@ -362,6 +362,26 @@ TEH_RESPONSE_reply_internal_error (struct MHD_Connection *connection,
/**
+ * Send a response indicating an error.
+ *
+ * @param connection the MHD connection to use
+ * @param ec error code uniquely identifying the error
+ * @param http_status HTTP status code to use
+ * @return a MHD result code
+ */
+int
+TEH_RESPONSE_reply_with_error (struct MHD_Connection *connection,
+ enum TALER_ErrorCode ec,
+ unsigned int http_status)
+{
+ return TEH_RESPONSE_reply_json_pack (connection,
+ http_status,
+ "{s:I}",
+ "code", (json_int_t) ec);
+}
+
+
+/**
* Send a response indicating an external error.
*
* @param connection the MHD connection to use