"""exception raise by this package"""fromtypingimportAny,Optionalfromrequests.modelsimportResponse
[docs]classTransmissionError(Exception):""" This exception is raised when there has occurred an error related to communication with Transmission. """message:strmethod:Optional[Any]# rpc call methodargument:Optional[Any]# rpc call argumentsresponse:Optional[Any]# parsed json response, may be dict with keys 'result' and 'arguments'rawResponse:Optional[str]# raw text http responseoriginal:Optional[Response]# original http requests
def__str__(self)->str:ifself.original:original_name=type(self.original).__name__returnf'{self.message} Original exception: {original_name}, "{self.original}"'returnself.message
[docs]classTransmissionAuthError(TransmissionError):"""Raised when username or password is incorrect"""
[docs]classTransmissionConnectError(TransmissionError):"""raised when client can't connect to transmission daemon"""