from__future__importannotationsimportgrpcclassUdbError(Exception):"""Base exception for the UDB Python SDK."""classUdbConfigurationError(UdbError):"""Raised when client configuration is invalid."""classUdbRpcError(UdbError):"""Raised when the broker returns a non-OK gRPC status."""def__init__(self,rpc_name:str,error:grpc.RpcError):self.rpc_name=rpc_nameself.raw=errorself.code=error.code()self.details=error.details()or""super().__init__(f"UDB {rpc_name} failed: gRPC status={self.code.name} details={self.details}")