"""Exception/error declarations for the vector interface."""fromtypingimportAny,Optional,UnionfromcanimportCanError,CanInitializationError,CanOperationError
[docs]classVectorError(CanError):def__init__(self,error_code:Optional[int],error_string:str,function:str)->None:super().__init__(message=f"{function} failed ({error_string})",error_code=error_code)# keep reference to args for picklingself._args=error_code,error_string,functiondef__reduce__(self)->Union[str,tuple[Any,...]]:returntype(self),self._args,{}