Exceptions

exception APIError

Bases: Exception

Base error for all exceptions from this Client.

exception UnsupportedQbittorrentVersion

Bases: APIError

Connected qBittorrent is not fully supported by this Client.

exception FileError

Bases: OSError, APIError

Base class for all exceptions for file handling.

exception TorrentFileError

Bases: FileError

Base class for all exceptions for torrent files.

exception TorrentFileNotFoundError

Bases: TorrentFileError

Specified torrent file does not appear to exist.

exception TorrentFilePermissionError

Bases: TorrentFileError

Permission was denied to read the specified torrent file.

exception APIConnectionError(*args, **kwargs) None

Bases: RequestException, APIError

Base class for all communications errors including HTTP errors.

exception LoginFailed(*args, **kwargs) None

Bases: APIConnectionError

This can technically be raised with any request since log in may be attempted for any request and could fail.

exception HTTPError(*args, **kwargs) None

Bases: HTTPError, APIConnectionError

Base error for all HTTP errors.

All errors following a successful connection to qBittorrent are returned as HTTP statuses.

http_status_code: int
exception HTTP4XXError(*args, **kwargs) None

Bases: HTTPError

Base error for all HTTP 4XX statuses.

exception HTTP5XXError(*args, **kwargs) None

Bases: HTTPError

Base error for all HTTP 5XX statuses.

exception HTTP400Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 400 Status.

http_status_code: int = 400
exception HTTP401Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 401 Status.

http_status_code: int = 401
exception HTTP403Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 403 Status.

http_status_code: int = 403
exception HTTP404Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 404 Status.

http_status_code: int = 404
exception HTTP405Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 405 Status.

http_status_code: int = 405
exception HTTP409Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 409 Status.

http_status_code: int = 409
exception HTTP415Error(*args, **kwargs) None

Bases: HTTP4XXError

HTTP 415 Status.

http_status_code: int = 415
exception HTTP500Error(*args, **kwargs) None

Bases: HTTP5XXError

HTTP 500 Status.

http_status_code: int = 500
exception MissingRequiredParameters400Error(*args, **kwargs) None

Bases: HTTP400Error

Endpoint call is missing one or more required parameters.

exception InvalidRequest400Error(*args, **kwargs) None

Bases: HTTP400Error

One or more endpoint arguments are malformed.

exception Unauthorized401Error(*args, **kwargs) None

Bases: HTTP401Error

Primarily reserved for XSS and host header issues.

exception Forbidden403Error(*args, **kwargs) None

Bases: HTTP403Error

Not logged in, IP has been banned, or calling an API method that isn’t public.

exception NotFound404Error(*args, **kwargs) None

Bases: HTTP404Error

This should mean qBittorrent couldn’t find a torrent for the torrent hash.

exception MethodNotAllowed405Error(*args, **kwargs) None

Bases: HTTP405Error

HTTP method is not supported for the API endpoint.

exception Conflict409Error(*args, **kwargs) None

Bases: HTTP409Error

Returned if arguments don’t make sense specific to the endpoint.

exception UnsupportedMediaType415Error(*args, **kwargs) None

Bases: HTTP415Error

torrents/add endpoint will return this for invalid URL(s) or files.

exception InternalServerError500Error(*args, **kwargs) None

Bases: HTTP500Error

Returned if qBittorrent errors internally while processing the request.