bug: handle connection errors in grpc for boser
This commit is contained in:
@@ -89,7 +89,7 @@ class BOSerWebAPI(BaseWebAPI):
|
|||||||
for cmd in tasks:
|
for cmd in tasks:
|
||||||
try:
|
try:
|
||||||
result[cmd] = await tasks[cmd]
|
result[cmd] = await tasks[cmd]
|
||||||
except (GRPCError, APIError):
|
except (GRPCError, APIError, ConnectionError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@@ -121,7 +121,7 @@ class BOSerWebAPI(BaseWebAPI):
|
|||||||
metadata = [("authorization", await self.auth())]
|
metadata = [("authorization", await self.auth())]
|
||||||
return (await endpoint(message, metadata=metadata)).to_pydict()
|
return (await endpoint(message, metadata=metadata)).to_pydict()
|
||||||
raise e
|
raise e
|
||||||
except GRPCError as e:
|
except (GRPCError, ConnectionError) as e:
|
||||||
raise APIError(f"gRPC command failed - {endpoint}") from e
|
raise APIError(f"gRPC command failed - {endpoint}") from e
|
||||||
|
|
||||||
async def auth(self) -> str | None:
|
async def auth(self) -> str | None:
|
||||||
|
|||||||
Reference in New Issue
Block a user