Пример #1
0
    def check(self):
        """
        Raises an exception if the status code is anything else than 0 (good).

        Use the is_good() method if you do not want an exception.
        """
        if not self.is_good():
            raise UaStatusCodeError(self.value)
Пример #2
0
 def setUp(self):
     self.direct = uaerrors.BadInternalError()
     self.indirect = UaStatusCodeError(self.status_code_bad_internal)
     self.unknown = UaStatusCodeError(self.status_code_unknown)