Python 3.11.1 (main, Dec 16 2022, 10:08:20) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tinyrpc.protocols.jsonrpc as jrpc
>>> response = jrpc.JSONRPCErrorResponse()
>>> response.error = "something went wrong"
>>> response._jsonrpc_error_code = -3
>>> response.unique_id = 1
>>> err = jrpc.JSONRPCError(response)
>>> err.error_respond()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".venv/lib/python3.11/site-packages/tinyrpc/protocols/jsonrpc.py", line 114, in error_respond
response._jsonrpc_error_code = self.jsonrpc_error_code
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'JSONRPCError' object has no attribute 'jsonrpc_error_code'. Did you mean: '_jsonrpc_error_code'?
Is it that https://github.com/mbr/tinyrpc/blob/master/tinyrpc/protocols/jsonrpc.py#L174 (and line 180) need to lose the leading
_on assignment toself._jsonrpc_error_codeso thatJSONRPCErroris aligned with the existing exception types above it (likeJSONRPCServerError) which have ajsonrpc_error_codeclass attribute?