fix error reporting in json rpc