better error handling in jsonrpc requests

left over from the 1898 fix is the out-of-order error handling which obscures useful messages