olivia_finder.utilities.exception

 1class OliviaFinderException(Exception, BaseException):
 2    """Base class for exceptions in this module."""
 3    
 4    def __init__(self, message: str):
 5        '''
 6        Constructor of the class
 7
 8        Parameters
 9        ----------
10        message : str
11            Message of the exception
12        errors : list, optional
13            List of errors, by default None
14        '''
15        super().__init__(message)
16        self.message = message
17
18
19    def __str__(self):
20        '''String representation of the exception'''
21        return f"{self.__class__.__name__}: {self.message}"
22    
23    def __repr__(self):
24        '''Representation of the exception'''
25        return f"{self.__class__.__name__}: {self.message}"
26
27class ConfigFileNotFound(OliviaFinderException):
28    """Exception raised when the config file is not found"""
29
30class ConfigKeyNotFound(OliviaFinderException):
31    """Exception raised when the key is not found in the config file"""
32    
33    
class OliviaFinderException(builtins.Exception, builtins.BaseException):
 2class OliviaFinderException(Exception, BaseException):
 3    """Base class for exceptions in this module."""
 4    
 5    def __init__(self, message: str):
 6        '''
 7        Constructor of the class
 8
 9        Parameters
10        ----------
11        message : str
12            Message of the exception
13        errors : list, optional
14            List of errors, by default None
15        '''
16        super().__init__(message)
17        self.message = message
18
19
20    def __str__(self):
21        '''String representation of the exception'''
22        return f"{self.__class__.__name__}: {self.message}"
23    
24    def __repr__(self):
25        '''Representation of the exception'''
26        return f"{self.__class__.__name__}: {self.message}"

Base class for exceptions in this module.

OliviaFinderException(message: str)
 5    def __init__(self, message: str):
 6        '''
 7        Constructor of the class
 8
 9        Parameters
10        ----------
11        message : str
12            Message of the exception
13        errors : list, optional
14            List of errors, by default None
15        '''
16        super().__init__(message)
17        self.message = message

Constructor of the class

Parameters
  • message (str): Message of the exception
  • errors (list, optional): List of errors, by default None
Inherited Members
builtins.BaseException
with_traceback
class ConfigFileNotFound(OliviaFinderException):
28class ConfigFileNotFound(OliviaFinderException):
29    """Exception raised when the config file is not found"""

Exception raised when the config file is not found

Inherited Members
OliviaFinderException
OliviaFinderException
builtins.BaseException
with_traceback
class ConfigKeyNotFound(OliviaFinderException):
31class ConfigKeyNotFound(OliviaFinderException):
32    """Exception raised when the key is not found in the config file"""

Exception raised when the key is not found in the config file

Inherited Members
OliviaFinderException
OliviaFinderException
builtins.BaseException
with_traceback