mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Adjust RPCTypeCheckObj error string
This commit is contained in:
@@ -65,11 +65,8 @@ void RPCTypeCheckObj(const UniValue& o,
|
||||
if (!fAllowNull && v.isNull())
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("Missing %s", t.first));
|
||||
|
||||
if (!(t.second.typeAny || v.type() == t.second.type || (fAllowNull && v.isNull()))) {
|
||||
std::string err = strprintf("Expected type %s for %s, got %s",
|
||||
uvTypeName(t.second.type), t.first, uvTypeName(v.type()));
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, err);
|
||||
}
|
||||
if (!(t.second.typeAny || v.type() == t.second.type || (fAllowNull && v.isNull())))
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, strprintf("JSON value of type %s for field %s is not of expected type %s", uvTypeName(v.type()), t.first, uvTypeName(t.second.type)));
|
||||
}
|
||||
|
||||
if (fStrict)
|
||||
|
||||
Reference in New Issue
Block a user