Beispiel #1
0
 def _db_command(self, input: Dict[str, Any]) -> Any:
     try:
         return from_json_bytes(self._backend.db_command(to_json_bytes(input)))
     except Exception as e:
         err_bytes = bytes(e.args[0])
     err = pb.BackendError()
     err.ParseFromString(err_bytes)
     raise backend_exception_to_pylib(err)
Beispiel #2
0
 def _run_command(self, service: int, method: int, input: Any) -> bytes:
     input_bytes = input.SerializeToString()
     try:
         return self._backend.command(service, method, input_bytes)
     except Exception as e:
         err_bytes = bytes(e.args[0])
     err = pb.BackendError()
     err.ParseFromString(err_bytes)
     raise backend_exception_to_pylib(err)