diff options
| author | Gavin Andresen <[email protected]> | 2012-07-17 12:02:31 -0400 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2012-07-17 12:02:31 -0400 |
| commit | 18871d4785d579a2da64dab79e6258b9170ef150 (patch) | |
| tree | 3c8167ece82cd844863adb002328731d5f578e39 /src/bitcoinrpc.cpp | |
| parent | Merge pull request #1604 from Diapolo/fix_comment_net (diff) | |
| download | discoin-18871d4785d579a2da64dab79e6258b9170ef150.tar.xz discoin-18871d4785d579a2da64dab79e6258b9170ef150.zip | |
Give a better error message than 'type mismatch' for complex JSON arguments
Diffstat (limited to 'src/bitcoinrpc.cpp')
| -rw-r--r-- | src/bitcoinrpc.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index c2bf45e1e..85ef9031c 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2957,8 +2957,9 @@ void ConvertTo(Value& value) { // 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 |