If a JSON RPC method is called with the wrong number of arguments, "invalid params" (error code -32602) should be replied (http://www.jsonrpc.org/specification#error_object). At the moment, however, the signature isn't checked. Thus, a simple TypeError is raised when the method is called, leading to a generic "server error" (code -32000).
This extends the default public decorator in such a way that it raises JSONRPCInvalidParamsError if necessary. This is not the right place for doing this, though, and I'd like it better if this would be done somewhere inside tinyrpc. Let me know, if I overlooked something or there's a better way of doing this.
If a JSON RPC method is called with the wrong number of arguments, "invalid params" (error code -32602) should be replied (http://www.jsonrpc.org/specification#error_object). At the moment, however, the signature isn't checked. Thus, a simple TypeError is raised when the method is called, leading to a generic "server error" (code -32000).
The hack I use at the moment looks like this:
This extends the default
public
decorator in such a way that it raisesJSONRPCInvalidParamsError
if necessary. This is not the right place for doing this, though, and I'd like it better if this would be done somewhere inside tinyrpc. Let me know, if I overlooked something or there's a better way of doing this.