Beispiel #1
0
 async def func_wrapper(*args: Any, **kwargs: Any) -> Any:  # pyre-ignore
     try:
         return await func(*args, **kwargs)
     except GRPCError as e:
         raise IdbException(e.message) from e  # noqa B306
     except (ProtocolError, StreamTerminatedError) as e:
         raise IdbException(e.args) from e
     except OSError as e:
         raise IdbConnectionException(e.strerror)
Beispiel #2
0
 async def func_wrapper_gen(*args: Any, **kwargs: Any) -> Any:
     try:
         async for item in func(*args, **kwargs):
             yield item
     except GRPCError as e:
         raise IdbException(e.message) from e  # noqa B306
     except (ProtocolError, StreamTerminatedError) as e:
         raise IdbException(e.args) from e
     except OSError as e:
         raise IdbConnectionException(e.strerror)