[docs]classUnexpectedMessageFormatError(RtError):"""Exception raised when response has bad status code (not the HTTP code, but code in the first line of the body as 200 in `RT/4.0.7 200 Ok`) or message parsing fails because of unexpected format. """
[docs]classNotFoundError(RtError):"""Exception raised if requested resource is not found."""
[docs]classAPISyntaxError(RtError):"""Exception raised when syntax error is received."""
[docs]classInvalidUseError(RtError):"""Exception raised when API method is not used correctly."""
[docs]classBadRequestError(RtError):"""Exception raised when HTTP code 400 (Bad Request) is received."""
[docs]classConnectionError(RtError):"""Encapsulation of various exceptions indicating network problems."""
[docs]def__init__(self,message:str,cause:Exception)->None:"""Initialization of exception extended by cause parameter. :keyword message: Exception details :keyword cause: Cause exception """super().__init__(f'{message} (Caused by {repr(cause)})')self.cause=cause
[docs]classInvalidQueryError(RtError):"""Exception raised when attempting to search RT with an invalid raw query."""