throw exception if JSON-RPC response represents an error