Browse Source

[bitcoin-cli] improve error output

pull/4/head
Jonas Schnelli 9 years ago
committed by Jack Grigg
parent
commit
f061578b8f
No known key found for this signature in database GPG Key ID: 6A6914DAFBEA00DA
  1. 9
      src/bitcoin-cli.cpp

9
src/bitcoin-cli.cpp

@ -200,6 +200,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())

Loading…
Cancel
Save