"""Collection of exceptions."""
[docs]class ClientException(Exception):
"""Base class for exceptions raised from the client."""
pass
[docs]class BadRequest(ClientException):
"""Request is not in the expected format."""
pass
[docs]class BadResponse(ClientException):
"""Response is not in the expected format."""
pass
[docs]class AIOSpamcConnectionFailed(ClientException):
"""Connection failed."""
pass
[docs]class TimeoutException(Exception):
"""General timeout exception."""
pass
[docs]class ClientTimeoutException(ClientException, TimeoutException):
"""Timeout exception from the client."""
pass
[docs]class ParseError(Exception):
"""Error occurred while parsing."""
[docs] def __init__(self, message=None):
"""Construct parsing exception with optional message.
:param message: User friendly message.
"""
self.message = message
[docs]class NotEnoughDataError(ParseError):
"""Expected more data than what the protocol content specified."""
pass
[docs]class TooMuchDataError(ParseError):
"""Too much data was received than what the protocol content specified."""
pass