2 Define exceptions to be raised at various places in the stack 9 SubClass = type.__new__(mcs, name, bases, dict)
14 subclasses = base._subclasses
16 except (AttributeError, KeyError):
19 subclasses[code] = SubClass
29 This exception is raised when a bad status code is encountered. 31 It exposes the status code number in the `code' property, so the 32 user can distinguish between the different status codes and maybe 35 The list of status error codes can be found in opcua.ua.status_codes. 38 """ Dict containing all subclasses keyed to their status code. """ 43 Creates a new UaStatusCodeError but returns a more specific subclass 46 UaStatusCodeError(0x80010000) => BadUnexpectedError() 54 except (KeyError, AttributeError):
59 return UaError.__new__(cls, *args)
63 :param code: The code of the exception. Only needed when not instanciating 64 a concrete subclass such as BadInternalError. 67 if type(self)
is UaStatusCodeError:
68 raise TypeError(
"UaStatusCodeError(code) cannot be instantiated without a status code.")
69 UaError.__init__(self, code)
75 return "{1}({0})".format(*status_codes.get_name_and_doc(self.
code))
80 The code of the status error. def with_metaclass(Meta, bases)
def __new__(mcs, name, bases, dict)
def __init__(self, code=None)