Skip to content

exceptions

Module for managing exceptions raised by ERAD package.

DatabaseMissingInfo

Bases: ERADBaseException

Exception raised because information required to connect to database is missing.

Source code in erad\exceptions.py
37
38
class DatabaseMissingInfo(ERADBaseException):
    """Exception raised because information required to connect to database is missing."""

DittoException

Bases: ERADBaseException

Exceptions raised because application ran into an issus using Ditto.

Source code in erad\exceptions.py
67
68
class DittoException(ERADBaseException):
    """Exceptions raised because application ran into an issus using Ditto."""

ERADBaseException

Bases: Exception

All exception should derive from this.

Source code in erad\exceptions.py
7
8
class ERADBaseException(Exception):
    """All exception should derive from this."""

EmptyEnvironmentVariable

Bases: ERADBaseException

Exception raised because environment variable required is empty.

Source code in erad\exceptions.py
33
34
class EmptyEnvironmentVariable(ERADBaseException):
    """Exception raised because environment variable required is empty."""

EmptyScenarioPolygon

Bases: ERADBaseException

Exceptions raised because no polygons are found.

Source code in erad\exceptions.py
54
55
class EmptyScenarioPolygon(ERADBaseException):
    """Exceptions raised because no polygons are found."""

FeatureNotImplementedError

Bases: ERADBaseException

Exception raised because specific feature requested has not been implemented.

Source code in erad\exceptions.py
11
12
class FeatureNotImplementedError(ERADBaseException):
    """Exception raised because specific feature requested has not been implemented."""

InvalidFileTypePassed

Bases: ERADBaseException

Exceptions raised because invalid file type is passed.

Source code in erad\exceptions.py
41
42
43
44
45
46
47
class InvalidFileTypePassed(ERADBaseException):
    """Exceptions raised because invalid file type is passed."""

    def __init__(self, path, valid_type):

        self.message = f"Invalid file type of {Path(path).suffix} is passed! Please pass valid file type of {valid_type}"
        super().__init__(self.message)

MultiStatePlaneError

Bases: ERADBaseException

Exceptions raised because the corrdinates are in more than one state plane coordinates.

Source code in erad\exceptions.py
62
63
64
class MultiStatePlaneError(ERADBaseException):
    """Exceptions raised because the corrdinates are in more than one state plane
    coordinates."""

NotAFileError

Bases: ERADBaseException

Exception raised because file is expected but folder path is provided.

Source code in erad\exceptions.py
25
26
27
28
29
30
class NotAFileError(ERADBaseException):
    """Exception raised because file is expected but folder path is provided."""

    def __init__(self, path):
        self.message = f"Expected file path {path} is not a file!"
        super().__init__(self.message)

OpenDSSCommandError

Bases: ERADBaseException

Exceptions raised because opendss command execution ran into an error.

Source code in erad\exceptions.py
58
59
class OpenDSSCommandError(ERADBaseException):
    """Exceptions raised because opendss command execution ran into an error."""

PathDoesNotExist

Bases: ERADBaseException

Exception raised bacause expected file/folder path does not exist.

Source code in erad\exceptions.py
15
16
17
18
19
20
21
22
class PathDoesNotExist(ERADBaseException):
    """Exception raised bacause expected file/folder path does not exist."""

    def __init__(self, path):
        self.message = (
            f"Expected path {path} does not exist. please check you file path!"
        )
        super().__init__(self.message)

SMARTDSInvalidInput

Bases: ERADBaseException

Exceptions raised because invalid input is provided for SMART DS data download.

Source code in erad\exceptions.py
50
51
class SMARTDSInvalidInput(ERADBaseException):
    """Exceptions raised because invalid input is provided for SMART DS data download."""