Source code for pyisyox.exceptions

"""Exceptions used by the PyISYoX module."""

# FUTURE: change to xmltodict.expat.ExpatError
from xml.parsers.expat import ExpatError

XML_ERRORS = (AttributeError, KeyError, ValueError, TypeError, IndexError, ExpatError)
XML_PARSE_ERROR = "ISY Could not parse response, poorly formatted XML."


[docs] class ISYInvalidAuthError(Exception): """Invalid authorization credentials provided."""
[docs] class ISYConnectionError(Exception): """Invalid connection parameters provided."""
[docs] class ISYNotInitializedError(Exception): """Invalid connection parameters provided."""
[docs] class ISYResponseParseError(Exception): """Error parsing a response provided by the ISY."""
[docs] class ISYResponseError(Exception): """Error receiving a response provided by the ISY."""
[docs] class ISYStreamDataError(Exception): """Invalid data in the isy event stream."""
[docs] class ISYStreamDisconnected(ISYStreamDataError): """The isy has disconnected."""
[docs] class ISYMaxConnections(ISYStreamDisconnected): """The isy has disconnected because it reached maximum connections."""