changeset 3224:19b54b57cfd6 draft

Give a better error message than 'type mismatch' for complex JSON arguments
author Gavin Andresen <gavinandresen@gmail.com>
date Tue, 17 Jul 2012 12:02:31 -0400
parents fd81dd33969c
children 13158535565e
files src/bitcoinrpc.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -2957,8 +2957,9 @@
     {
         // reinterpret string as unquoted json value
         Value value2;
-        if (!read_string(value.get_str(), value2))
-            throw runtime_error("type mismatch");
+        string strJSON = value.get_str();
+        if (!read_string(strJSON, value2))
+            throw runtime_error(string("Error parsing JSON:")+strJSON);
         value = value2.get_value<T>();
     }
     else