diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-07-08 09:40:13 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-07-08 09:40:13 +0200 |
commit | ea5c1233f13ad3128207b6b84401d8638dbc43e5 (patch) | |
tree | 4ee2fc37580df6079af9acb339de804ee38846d7 /src/util | |
parent | 296e27b92ab0367f414dc0e98b185531c8df06f3 (diff) |
nicer error reporting
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/json.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util/json.c b/src/util/json.c index e4b0831a4..004f7734c 100644 --- a/src/util/json.c +++ b/src/util/json.c @@ -297,7 +297,19 @@ TALER_json_to_amount (json_t *json, "fraction", &fraction, "currency", ¤cy)) { + char *json_enc; + GNUNET_break_op (0); + if (NULL == (json_enc = json_dumps (json, + JSON_COMPACT | JSON_SORT_KEYS | JSON_ENCODE_ANY))) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Malformed JSON amount: %s\n", + json_enc); + free (json_enc); return GNUNET_SYSERR; } if ( (value < 0) || @@ -415,7 +427,7 @@ TALER_hash_json (json_t *json, GNUNET_CRYPTO_hash (wire_enc, len, hc); - GNUNET_free (wire_enc); + free (wire_enc); return GNUNET_OK; } |