Source code for xled.exceptions
# -*- coding: utf-8 -*-
[docs]class XledException(IOError):
def __init__(self, *args, **kwargs):
super(XledException, self).__init__(*args, **kwargs)
[docs]class ApplicationError(XledException):
"""Application didn't return successful status code"""
def __init__(self, *args, **kwargs):
"""Initializes ApplicationError with `response` object."""
response = kwargs.pop("response", None)
self.response = response
super(ApplicationError, self).__init__(*args, **kwargs)
[docs]class ValidationError(XledException):
"""Validation of challenge response wasn't successful"""
[docs]class AuthenticationError(XledException):
"""Authentication handshake wasn't successful"""
[docs]class TokenExpiredError(XledException):
"""Token is no longer valid"""
[docs]class HighInterfaceError(XledException):
"""High level interface error"""
[docs]class ReceiveTimeout(XledException):
"""Signal that timeout occurred while waiting for data"""
[docs]class DiscoverTimeout(XledException):
"""Signal that timeout occurred while discover is looking for a device"""