summaryrefslogtreecommitdiff
path: root/src/include/taler_mhd_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-31 11:23:42 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-31 11:23:42 +0100
commitb49fac3d5892f75a2eb7fbfbca0056965c6967c7 (patch)
tree65af67ab223775b43b82aa6e34ac0616cd146197 /src/include/taler_mhd_lib.h
parent5cd2bc5de3abf5863ac1718043485a2a74a3d364 (diff)
downloadexchange-b49fac3d5892f75a2eb7fbfbca0056965c6967c7.tar.gz
exchange-b49fac3d5892f75a2eb7fbfbca0056965c6967c7.tar.bz2
exchange-b49fac3d5892f75a2eb7fbfbca0056965c6967c7.zip
-introduce new convenience macro
Diffstat (limited to 'src/include/taler_mhd_lib.h')
-rw-r--r--src/include/taler_mhd_lib.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h
index 7f38ffcf5..b0012a645 100644
--- a/src/include/taler_mhd_lib.h
+++ b/src/include/taler_mhd_lib.h
@@ -250,6 +250,17 @@ TALER_MHD_make_json_pack (const char *fmt,
/**
+ * Pack Taler error code @a ec and associated hint into a
+ * JSON object.
+ *
+ * @param ec error code to pack
+ * @return packer array entries (two!)
+ */
+#define TALER_MHD_PACK_EC(ec) \
+ GNUNET_JSON_pack_uint64 ("code", ec), \
+ GNUNET_JSON_pack_string ("hint", TALER_ErrorCode_get_hint (ec))
+
+/**
* Create a response indicating an internal error.
*
* @param ec error code to return