Skip to content

Exceptions

All the exceptions that might be raised by the libary come from the exceptions module.

oarepo_c4gh.exceptions

This module defines all the exceptions the Crypt4GH library may produce.

Crypt4GHDEKException

Bases: Crypt4GHException

Base exception raised when something goes wrong with Data Encryption Key(s).

Source code in oarepo_c4gh/exceptions.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
class Crypt4GHDEKException(Crypt4GHException):
    """Base exception raised when something goes wrong with Data
    Encryption Key(s).

    """

    def __init__(self, message: str) -> None:
        """Initializes the DEK exception.

        Parameters:
            message: a descriptive message about the problem

        """
        super().__init__("DEK", message)

__init__(message: str) -> None

Initializes the DEK exception.

Parameters:

Name Type Description Default
message str

a descriptive message about the problem

required
Source code in oarepo_c4gh/exceptions.py
83
84
85
86
87
88
89
90
def __init__(self, message: str) -> None:
    """Initializes the DEK exception.

    Parameters:
        message: a descriptive message about the problem

    """
    super().__init__("DEK", message)

Crypt4GHException

Bases: Exception

Basic Crypt4GH exception from which all exceptions must be derived. This exception must not be used directly.

Source code in oarepo_c4gh/exceptions.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
class Crypt4GHException(Exception):
    """Basic Crypt4GH exception from which all exceptions must be
    derived. This exception must not be used directly.

    """

    def __init__(self, ecode: str, message: str) -> None:
        """Initializes the internal exception code. This is used by
        derived exceptions to specify the machine-readable exception
        code.

        Parameters:
            ecode: internal machine-readable string identifying the exception
            message: a descriptive message about the problem

        """
        super().__init__(message)
        self._code = ecode

    @property
    def code(self) -> str:
        """The machine-readable exception code provided as instance
        exception property for convenience.

        """
        return self._code

code: str property

The machine-readable exception code provided as instance exception property for convenience.

__init__(ecode: str, message: str) -> None

Initializes the internal exception code. This is used by derived exceptions to specify the machine-readable exception code.

Parameters:

Name Type Description Default
ecode str

internal machine-readable string identifying the exception

required
message str

a descriptive message about the problem

required
Source code in oarepo_c4gh/exceptions.py
13
14
15
16
17
18
19
20
21
22
23
24
def __init__(self, ecode: str, message: str) -> None:
    """Initializes the internal exception code. This is used by
    derived exceptions to specify the machine-readable exception
    code.

    Parameters:
        ecode: internal machine-readable string identifying the exception
        message: a descriptive message about the problem

    """
    super().__init__(message)
    self._code = ecode

Crypt4GHHeaderException

Bases: Crypt4GHException

An exception related to Crypt4GH header processing problem.

Source code in oarepo_c4gh/exceptions.py
50
51
52
53
54
55
56
57
58
59
class Crypt4GHHeaderException(Crypt4GHException):
    """An exception related to Crypt4GH header processing problem."""

    def __init__(self, message: str) -> None:
        """Initializes the header exception.

        Parameters:
            message: a descriptive message about the problem
        """
        super().__init__("HEADER", message)

__init__(message: str) -> None

Initializes the header exception.

Parameters:

Name Type Description Default
message str

a descriptive message about the problem

required
Source code in oarepo_c4gh/exceptions.py
53
54
55
56
57
58
59
def __init__(self, message: str) -> None:
    """Initializes the header exception.

    Parameters:
        message: a descriptive message about the problem
    """
    super().__init__("HEADER", message)

Crypt4GHHeaderPacketException

Bases: Crypt4GHException

An exception related to particular Crypt4GH header packet processing problem.

Source code in oarepo_c4gh/exceptions.py
62
63
64
65
66
67
68
69
70
71
72
73
74
class Crypt4GHHeaderPacketException(Crypt4GHException):
    """An exception related to particular Crypt4GH header packet
    processing problem.

    """

    def __init__(self, message: str) -> None:
        """Initializes the header packet exception.

        Parameters:
            message: a descriptive message about the problem
        """
        super().__init__("HEADERPACKET", message)

__init__(message: str) -> None

Initializes the header packet exception.

Parameters:

Name Type Description Default
message str

a descriptive message about the problem

required
Source code in oarepo_c4gh/exceptions.py
68
69
70
71
72
73
74
def __init__(self, message: str) -> None:
    """Initializes the header packet exception.

    Parameters:
        message: a descriptive message about the problem
    """
    super().__init__("HEADERPACKET", message)

Crypt4GHKeyException

Bases: Crypt4GHException

An exception for any problems related to the user-provided cryptographic keys and not the Crypt4GH containers themselves.

Source code in oarepo_c4gh/exceptions.py
35
36
37
38
39
40
41
42
43
44
45
46
47
class Crypt4GHKeyException(Crypt4GHException):
    """An exception for any problems related to the user-provided
    cryptographic keys and not the Crypt4GH containers themselves.

    """

    def __init__(self, message: str) -> None:
        """Initializes the key exception.

        Parameters:
            message: a descriptive message about the problem
        """
        super().__init__("KEY", message)

__init__(message: str) -> None

Initializes the key exception.

Parameters:

Name Type Description Default
message str

a descriptive message about the problem

required
Source code in oarepo_c4gh/exceptions.py
41
42
43
44
45
46
47
def __init__(self, message: str) -> None:
    """Initializes the key exception.

    Parameters:
        message: a descriptive message about the problem
    """
    super().__init__("KEY", message)

Crypt4GHProcessedException

Bases: Crypt4GHException

An exception for signalling the container cannot be processed again from the beginning.

Source code in oarepo_c4gh/exceptions.py
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
class Crypt4GHProcessedException(Crypt4GHException):
    """An exception for signalling the container cannot be processed
    again from the beginning.

    """

    def __init__(self, message: str) -> None:
        """Initializes the Processed exception.

        Parameters:
            message: a decriptive message about the problem

        """
        super().__init__("PROCESSED", message)

__init__(message: str) -> None

Initializes the Processed exception.

Parameters:

Name Type Description Default
message str

a decriptive message about the problem

required
Source code in oarepo_c4gh/exceptions.py
 99
100
101
102
103
104
105
106
def __init__(self, message: str) -> None:
    """Initializes the Processed exception.

    Parameters:
        message: a decriptive message about the problem

    """
    super().__init__("PROCESSED", message)