diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-07-08 13:37:14 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-07-08 13:39:57 +0200 |
commit | 11576a57d2ee37aa421e0fce69e70751b5af9a61 (patch) | |
tree | 21282d50ea4c204ed9257ef0cef04e53cf2a5d00 /src | |
parent | 6a73d6688380f78c024a1bf2ed0a7d1dfb72dace (diff) | |
parent | 65ce0215a461318c5d7caf3f35cfeef947171a5a (diff) |
Merge pull request #6387
65ce021 [bitcoin-cli] improve error output (Jonas Schnelli)
Diffstat (limited to 'src')
-rw-r--r-- | src/bitcoin-cli.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index d451720141..903777ba51 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -190,6 +190,15 @@ int CommandLineRPC(int argc, char *argv[]) throw CConnectionFailed("server in warmup"); strPrint = "error: " + error.write(); nRet = abs(code); + if (error.isObject()) + { + UniValue errCode = find_value(error, "code"); + UniValue errMsg = find_value(error, "message"); + strPrint = errCode.isNull() ? "" : "error code: "+errCode.getValStr()+"\n"; + + if (errMsg.isStr()) + strPrint += "error message:\n"+errMsg.get_str(); + } } else { // Result if (result.isNull()) |