diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-01 15:36:38 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-01 15:36:38 +0200 |
commit | d45774ccecaed85f45c2eebe641e2d2f8c8673af (patch) | |
tree | 7c15d023eed2b7f47c0496ddc982d881cb398d6d /src/include/taler_json_lib.h | |
parent | f1f0bf637bcfd7d10d3acdb328d016ccf2cc4ffb (diff) | |
download | exchange-d45774ccecaed85f45c2eebe641e2d2f8c8673af.tar.xz |
introduce TALER_JSON_pack_ec
Diffstat (limited to 'src/include/taler_json_lib.h')
-rw-r--r-- | src/include/taler_json_lib.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index f338d44ae..ea621cea6 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -80,6 +80,16 @@ TALER_JSON_pack_time_abs_nbo (const char *name, /** + * Put an error code into a JSON reply, including + * both the numeric value and the hint. + * + * @param ec error code to encode using canonical field names + */ +#define TALER_JSON_pack_ec(ec) \ + GNUNET_JSON_pack_string ("hint", TALER_ErrorCode_get_hint (ec)), \ + GNUNET_JSON_pack_uint64 ("code", ec) + +/** * Generate packer instruction for a JSON field of type * absolute time creating a human-readable timestamp. * |