Пример #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 proto_exception_to_native(err)
Пример #2
0
 def _run_command(self, method: int, input: Any) -> bytes:
     input_bytes = input.SerializeToString()
     try:
         return self._backend.command(method, input_bytes)
     except Exception as e:
         err_bytes = bytes(e.args[0])
     err = pb.BackendError()
     err.ParseFromString(err_bytes)
     raise proto_exception_to_native(err)
Пример #3
0
    def _run_command(self, service: int, method: int, input: bytes) -> bytes:
        try:
            return self._backend.command(service, method, input)
        except Exception as error:
            error_bytes = bytes(error.args[0])

        err = backend_pb2.BackendError()
        err.ParseFromString(error_bytes)
        raise backend_exception_to_pylib(err)
Пример #4
0
 def _db_command(self, input: dict[str, Any]) -> Any:
     bytes_input = to_json_bytes(input)
     try:
         return from_json_bytes(self._backend.db_command(bytes_input))
     except Exception as error:
         err_bytes = bytes(error.args[0])
     err = backend_pb2.BackendError()
     err.ParseFromString(err_bytes)
     raise backend_exception_to_pylib(err)
Пример #5
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 = backend_pb2.BackendError()
     err.ParseFromString(err_bytes)
     raise backend_exception_to_pylib(err)