meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
programming:python:tinyrpc [2024/01/01 18:32] niziakprogramming:python:tinyrpc [2024/01/01 18:49] (current) niziak
Line 15: Line 15:
 </code> </code>
  
-and exception ''e'' is wrapped as RPC error response:+and exception ''e'' is wrapped as response using ''RPCRequest.error_respond()'':
   * [[https://github.com/mbr/tinyrpc/blob/1.1.4/tinyrpc/protocols/__init__.py#L62|RPCRequest.error_respond()]]   * [[https://github.com/mbr/tinyrpc/blob/1.1.4/tinyrpc/protocols/__init__.py#L62|RPCRequest.error_respond()]]
-  * [[https://github.com/mbr/tinyrpc/blob/1.1.4/tinyrpc/protocols/jsonrpc.py#L104|JSONRPC FixedErrorMessageMixin.error_response]]+  * [[https://github.com/mbr/tinyrpc/blob/1.1.4/tinyrpc/protocols/jsonrpc.py#L377|JSONRPCRequest.error_respond()]] 
 +  * [[https://github.com/mbr/tinyrpc/blob/1.1.4/tinyrpc/protocols/jsonrpc.py#L287|_get_code_message_and_data()]]
  
 +
 +TODO:
 +How to provide more detailed exception do client - i.e. exception type and backtrace ?
 +Possible solutions:
 +  - Create own ''RPCDispatcher'' with own ''dispatch()'' method, where exception will carry also ''.data''
 +  - Create own JSONRPCProtocol with changed JSONRPCRequest().error_respond(), where full exception is unwinded and serialized in JSON data field.