P
P
Pashka232020-03-25 13:28:35
JSON
Pashka23, 2020-03-25 13:28:35

When to return an RPC execution error message in a JSON-RPC body?

I'm reading the json-rpc specification ( https://www.jsonrpc.org/specification) and I can't figure it out - error messages are passed inside json-rpc (in the error field) only when the method cannot be executed for some reason ? If the method was called with the correct parameters, but ended incorrectly, is the error message already transmitted at a higher level? Those. for example, for a server with set(name) and get(name) functions, you will have to screw an additional level on top to report the results of executing the functions themselves (for example, return an error if an attempt is made to take a non-existent parameter and do not send at the json-rpc level error messages because the method was called successfully)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2020-03-25
@Pashka23

So you have one request, one answer. And the answer is either an error or a result.
And it will always return an error: both for "Invalid request", "method not found" and "Index out of range"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question