jussi icon indicating copy to clipboard operation
jussi copied to clipboard

Error response on JSON-RPC request inside of batch should be inside of batch

Open mvandeberg opened this issue 6 years ago • 0 comments

steemit/steem#2584

Just now, the following "BATCH" JSON-RPC call to https://api.steemitstage.com/ :

[{"params": [], "jsonrpc": "2.0", "method": "condenser_api.get_dynamic_global_properties", "id": 1}]

Gave back an "OBJECT" response close to this:

{"jsonrpc": "2.0", "error": {"message": "Internal Error", "code": -32603, "data': {"error_id": "2fe7b4a6-5777-41be-81f7-eb07a6be0ee4", "request": {"jussi_request_id": None, "amzn_trace_id": "Root=1-5b3b099a-4708324101f7cf5a14b26f85"}}}}

A JSON-RPC response on batch should always be a batch itself, not an object, and an "id" should preferably be present in each of its batch entries. Something like:

[{"jsonrpc": "2.0", "error": {"message": "Internal Error", "code": -32603, "data': {"error_id": "2fe7b4a6-5777-41be-81f7-eb07a6be0ee4", "request": {"jussi_request_id": None, "amzn_trace_id": "Root=1-5b3b099a-4708324101f7cf5a14b26f85"}}} "id": 1}

mvandeberg avatar Jul 03 '18 06:07 mvandeberg