Skip to contentSkip to conversation

asyncrpc: Fix attribute errors

PATCH New Daniel Gomez 1 participant 1 message Feb 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 asyncrpc: Fix attribute errors

Export ClientError and ServerError classes from bb.asyncrpc.serv as required by lib/hashserv/server.py module.

Error:
Client ('192.168.2.184', 51142) connected
Error from client: module 'bb.asyncrpc' has no attribute 'ClientError' Traceback (most recent call last):
File "/opt/bbhashserv/lib/bb/asyncrpc/serv.py", line 192, in handle_client
await client.process_requests()
File "/opt/bbhashserv/lib/hashserv/server.py", line 200, in process_requests
await super().process_requests()
File "/opt/bbhashserv/lib/bb/asyncrpc/serv.py", line 72, in process_requests
await self.dispatch_message(d)
File "/opt/bbhashserv/lib/hashserv/server.py", line 217, in dispatch_message
raise bb.asyncrpc.ClientError("Unrecognized command %r" % msg)
AttributeError: module 'bb.asyncrpc' has no attribute 'ClientError'

---
 lib/bb/asyncrpc/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/asyncrpc/__init__.py +1 -1
index b2bec31a..c2f2b3c0 100644
@@ -28,4 +28,4 @@ def chunkify(msg, max_chunk):
 
 
 from .client import AsyncClient, Client
-from .serv import AsyncServer, AsyncServerConnection
+from .serv import AsyncServer, AsyncServerConnection, ClientError, ServerError

--
2.34.1