[docs]classConflictingArgumentsError(Exception):""" This exception is returned when 2 arguments to the same function are in conflict. """
[docs]classInvalidDimensionOrderingError(Exception):""" A general exception that can be thrown when handling dimension ordering or validation. Should be provided with a message for the user to be given more context. """
[docs]classUnexpectedShapeError(Exception):""" A general exception that can be thrown when handling shape validation. Should be provided with a message for the user to be given more context. """
[docs]classUnsupportedFileFormatError(Exception):""" This exception is intended to communicate that the file extension is not one of the supported file types and cannot be parsed with AICSImage. """def__init__(self,reader_name:str,path:str,msg_extra:Optional[str]=None):super().__init__()self.reader_name=reader_nameself.path=pathself.msg_extra=msg_extradef__str__(self)->str:msg=f"{self.reader_name} does not support the image: '{self.path}'."ifself.msg_extraisnotNone:msg=f"{msg}{self.msg_extra}"returnmsg