script.module.gorrent2http/lib/gorrent2http/error.py

34 lines
1.3 KiB
Python
Raw Permalink Normal View History

2015-01-11 08:47:17 +03:00
class Error(Exception):
TORRENT_ERROR = 12
""" Error returned by libtorrent """
CRASHED = 13
""" torrent2http client has crashed abnormally """
2015-01-11 08:47:17 +03:00
UNKNOWN_PLATFORM = 1
""" Unknown/unsupported platform """
2015-01-11 08:47:17 +03:00
XBMC_HOME_NOT_DEFINED = 2
""" XBMC_HOME or KODI_HOME is not set """
2015-01-11 08:47:17 +03:00
NOEXEC_FILESYSTEM = 3
""" torrent2http binary is placed on noexec filesystem, so it can't be started """
2015-01-11 08:47:17 +03:00
REQUEST_ERROR = 5
""" Error occurred while sending request to torrent2http """
2015-01-11 08:47:17 +03:00
INVALID_DOWNLOAD_PATH = 6
""" Dowload path is invalid """
2015-01-11 08:47:17 +03:00
BIND_ERROR = 7
""" Bind error can occur on start, if it's impossible to find a port to bind torrent2http to """
2015-01-11 08:47:17 +03:00
POPEN_ERROR = 8
""" Can't start torrent2http client, path to binary doesn't exist or can't be executed """
2015-01-11 08:47:17 +03:00
PROCESS_ERROR = 9
""" torrent2http client started but exited abnormally, may be conflict in startup options """
2015-01-11 08:47:17 +03:00
TIMEOUT = 10
""" torrent2http not answered during specified timeout """
2015-01-11 08:47:17 +03:00
INVALID_FILE_INDEX = 11
""" Specified file index is invalid, no file with specified index found in torrent """
2015-01-11 08:47:17 +03:00
def __init__(self, message, code=0, **kwargs):
self.message = message
self.code = code
self.kwargs = kwargs
def __str__(self):
return self.message