# Gavin Andresen # 2011-11-16 22:43:14 # https://bitcointalk.org/index.php?topic=52024.msg621059#msg621059 bitcoind follows the JSON-RPC-over-HTTP spec for reporting errors, but it sounds like Sergio's library follows a different spec. You're not the first person to complain that bitcoind returns HTTP error codes; here's a one-line patch to change that behavior with a "-rpcerrorstatus=200" argument/option: @p{brk} Code: diff @p{--}git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp @p{brk} index 31ef725..447b55c 100644 @p{brk} @p{@p{--}-} a/src/bitcoinrpc.cpp @p{brk} +++ b/src/bitcoinrpc.cpp @p{brk} @@ -2088,6 +2088,9 @@ void ErrorReply(std::ostream& stream, const Object& objError, const Value& id) @p{brk} if (code == -32600) nStatus = 400; @p{brk} else if (code == -32601) nStatus = 404; @p{brk} string strReply = JSONRPCReply(Value::null, objError, id); @p{brk} + @p{brk} + // Allow overriding the HTTP status response: @p{brk} + nStatus = GetArg("-rpcerrorstatus", nStatus); @p{brk} stream @p{lt}@p{lt} HTTPReply(nStatus, strReply) @p{lt}@p{lt} std::flush; @p{brk} } @p{brk} @p{brk} Let me know if that solves the problem and/or if it causes any other issues; if it doesn't, I'll submit it as a PULL request. @p{brk}