Skip to content

errors.py

Defines errors for the pipeline to return.

MaxPipelineRunsError

Bases: PipelineError

Error for reporting the number of concurrent jobs is maxed out.

Source code in vast_pipeline/pipeline/errors.py
37
38
39
40
41
42
43
44
45
46
47
48
49
class MaxPipelineRunsError(PipelineError):
    """
    Error for reporting the number of concurrent jobs is maxed out.
    """

    def __str__(self) -> str:
        """
        Returns the string representation.

        Returns:
            The string representation of the error.
        """
        return 'Max pipeline concurrent runs reached!'

__str__()

Returns the string representation.

Returns:

Type Description
str

The string representation of the error.

Source code in vast_pipeline/pipeline/errors.py
42
43
44
45
46
47
48
49
def __str__(self) -> str:
    """
    Returns the string representation.

    Returns:
        The string representation of the error.
    """
    return 'Max pipeline concurrent runs reached!'

PipelineConfigError

Bases: PipelineError

Error for issue in the pipeline configuration

Source code in vast_pipeline/pipeline/errors.py
52
53
54
55
56
57
58
59
60
61
62
63
class PipelineConfigError(PipelineError):
    """
    Error for issue in the pipeline configuration
    """
    def __init__(self, msg: Optional[str] = None):
        """
        Initialises the config error.

        Args:
            msg: The error message returned by the pipeline.
        """
        super(PipelineConfigError, self).__init__(msg)

__init__(msg=None)

Initialises the config error.

Parameters:

Name Type Description Default
msg Optional[str]

The error message returned by the pipeline.

None
Source code in vast_pipeline/pipeline/errors.py
56
57
58
59
60
61
62
63
def __init__(self, msg: Optional[str] = None):
    """
    Initialises the config error.

    Args:
        msg: The error message returned by the pipeline.
    """
    super(PipelineConfigError, self).__init__(msg)

PipelineError

Bases: Exception

Generic pipeline error

Attributes:

Name Type Description
msg str

The full error string to return.

Source code in vast_pipeline/pipeline/errors.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class PipelineError(Exception):
    """
    Generic pipeline error

    Attributes:
        msg (str): The full error string to return.
    """

    def __init__(self, msg: Optional[str] = None) -> None:
        """
        Initialises the error.

        Args:
            msg: The error message returned by the pipeline.
        """
        self.msg = (
            'Pipeline error: {0}.'.format(msg) if msg else
            'Undefined Pipeline error.'
        )

    def __str__(self) -> str:
        """
        Returns the string representation.

        Returns:
            The string representation of the error.
        """
        return self.msg

__init__(msg=None)

Initialises the error.

Parameters:

Name Type Description Default
msg Optional[str]

The error message returned by the pipeline.

None
Source code in vast_pipeline/pipeline/errors.py
15
16
17
18
19
20
21
22
23
24
25
def __init__(self, msg: Optional[str] = None) -> None:
    """
    Initialises the error.

    Args:
        msg: The error message returned by the pipeline.
    """
    self.msg = (
        'Pipeline error: {0}.'.format(msg) if msg else
        'Undefined Pipeline error.'
    )

__str__()

Returns the string representation.

Returns:

Type Description
str

The string representation of the error.

Source code in vast_pipeline/pipeline/errors.py
27
28
29
30
31
32
33
34
def __str__(self) -> str:
    """
    Returns the string representation.

    Returns:
        The string representation of the error.
    """
    return self.msg

PipelineInitError

Bases: PipelineError

Error for issue in the pipeline initialisation

Source code in vast_pipeline/pipeline/errors.py
66
67
68
69
70
71
72
73
74
75
76
77
class PipelineInitError(PipelineError):
    """
    Error for issue in the pipeline initialisation
    """
    def __init__(self, msg: Optional[str] = None):
        """
        Initialises the init error.

        Args:
            msg: The error message returned by the pipeline.
        """
        super(PipelineInitError, self).__init__(msg)

__init__(msg=None)

Initialises the init error.

Parameters:

Name Type Description Default
msg Optional[str]

The error message returned by the pipeline.

None
Source code in vast_pipeline/pipeline/errors.py
70
71
72
73
74
75
76
77
def __init__(self, msg: Optional[str] = None):
    """
    Initialises the init error.

    Args:
        msg: The error message returned by the pipeline.
    """
    super(PipelineInitError, self).__init__(msg)