Skip to content

Exceptions

These exceptions are used within the code - there may be some generic OS exceptions that things like communications issues can throw as well:

Broadworks OCI-P Interface Exception Classes

Exception classes used by the API.

OCIError

Bases: Exception

Base Exception raised by OCI operations.

Attributes:

Name Type Description
message str

explanation of why it went bang

object

the thing that went bang

Source code in broadworks_ocip/exceptions.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@attr.s(slots=True, frozen=True)
class OCIError(Exception):
    """Base Exception raised by OCI operations.

    Attributes:
        message: explanation of why it went bang
        object: the thing that went bang
    """

    message: str = attr.ib()
    object = attr.ib(default=None)

    def __str__(self):
        return f"{self.__class__.__name__}({self.message})"

OCIErrorAPISetup

Bases: OCIError

Exception raised when life becomes too much for the software.

Subclass of OCIError()

Source code in broadworks_ocip/exceptions.py
59
60
61
62
63
64
65
66
67
@attr.s(slots=True, frozen=True)
class OCIErrorAPISetup(OCIError):
    """
    Exception raised when life becomes too much for the software.

    Subclass of OCIError()
    """

    pass

OCIErrorAttributeMissing

Bases: OCIError

Exception raised when a required attribute is missing.

Subclass of OCIError()

Source code in broadworks_ocip/exceptions.py
70
71
72
73
74
75
76
77
78
@attr.s(slots=True, frozen=True)
class OCIErrorAttributeMissing(OCIError):
    """
    Exception raised when a required attribute is missing.

    Subclass of OCIError()
    """

    pass

OCIErrorResponse

Bases: OCIError

Exception raised when an ErrorResponse is received and decoded.

Subclass of OCIError()

Source code in broadworks_ocip/exceptions.py
26
27
28
29
30
31
32
33
34
@attr.s(slots=True, frozen=True)
class OCIErrorResponse(OCIError):
    """
    Exception raised when an ErrorResponse is received and decoded.

    Subclass of OCIError()
    """

    pass

OCIErrorTimeOut

Bases: OCIError

Exception raised when nothing is head back from the server.

Subclass of OCIError()

Source code in broadworks_ocip/exceptions.py
37
38
39
40
41
42
43
44
45
@attr.s(slots=True, frozen=True)
class OCIErrorTimeOut(OCIError):
    """
    Exception raised when nothing is head back from the server.

    Subclass of OCIError()
    """

    pass

OCIErrorUnexpectedAttribute

Bases: OCIError

Exception raised when additional elements passed to init

Subclass of OCIError()

Source code in broadworks_ocip/exceptions.py
81
82
83
84
85
86
87
88
89
@attr.s(slots=True, frozen=True)
class OCIErrorUnexpectedAttribute(OCIError):
    """
    Exception raised when additional elements passed to __init__

    Subclass of OCIError()
    """

    pass

OCIErrorUnknown

Bases: OCIError

Exception raised when life becomes too much for the software.

Subclass of OCIError()

Source code in broadworks_ocip/exceptions.py
48
49
50
51
52
53
54
55
56
@attr.s(slots=True, frozen=True)
class OCIErrorUnknown(OCIError):
    """
    Exception raised when life becomes too much for the software.

    Subclass of OCIError()
    """

    pass