forked from Tribler/tribler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.py
73 lines (44 loc) · 1.82 KB
/
exceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Written by Arno Bakker
# see LICENSE.txt for license information
""" The Tribler-specifc Exceptions the Core may throw. """
#
# Exceptions
#
class TriblerException(Exception):
""" Super class for all Tribler-specific Exceptions the Tribler Core
throws.
"""
def __init__(self, msg=None):
Exception.__init__(self, msg)
def __str__(self):
return str(self.__class__) + ': ' + Exception.__str__(self)
class OperationNotPossibleAtRuntimeException(TriblerException):
""" The requested operation is not possible after the Session or Download
has been started.
"""
def __init__(self, msg=None):
TriblerException.__init__(self, msg)
class OperationNotEnabledByConfigurationException(TriblerException):
""" The requested operation is not possible with the current
Session/Download configuration.
"""
def __init__(self, msg=None):
TriblerException.__init__(self, msg)
class NotYetImplementedException(TriblerException):
""" The requested operation is not yet fully implemented. """
def __init__(self, msg=None):
TriblerException.__init__(self, msg)
class DuplicateDownloadException(TriblerException):
""" The Download already exists in the Session, i.e., a Download for
a torrent with the same infohash already exists. """
def __init__(self, msg=None):
TriblerException.__init__(self, msg)
class TorrentDefNotFinalizedException(TriblerException):
""" Attempt to start downloading a torrent from a torrent definition
that was not finalized. """
def __init__(self, msg=None):
TriblerException.__init__(self, msg)
class TorrentFileException(TriblerException):
""" The torrent file that is used is corrupt or cannot be read. """
def __init__(self, msg=None):
TriblerException.__init__(self, msg)