forked from rotki/rotki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.py
94 lines (58 loc) · 2.06 KB
/
errors.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python
class PoloniexError(Exception):
def __init__(self, err):
self.err = err
def __str__(self):
return self.err
class RecoverableRequestError(Exception):
def __init__(self, exchange, err):
self.exchange = exchange
self.err = err
def __str__(self):
return 'While querying {} got error: "{}"'.format(self.exchange, self.err)
class InputError(Exception):
pass
class EthSyncError(Exception):
pass
class AuthenticationError(Exception):
pass
class IncorrectApiKeyFormat(Exception):
pass
class UnableToDecryptRemoteData(Exception):
pass
class RotkehlchenPermissionError(Exception):
pass
class RemoteError(Exception):
"""Thrown when a remote API can't be reached or throws unexpected error"""
pass
class PriceQueryUnknownFromAsset(Exception):
def __init__(self, from_asset):
super().__init__(
'Unable to query historical price for Unknown Asset: "{}"'.format(from_asset),
)
class UnprocessableTradePair(Exception):
def __init__(self, pair: str):
self.pair = pair
super().__init__(f'Unprocessable pair {pair} encountered.')
class UnknownAsset(Exception):
def __init__(self, asset_name: str):
self.asset_name = asset_name
super().__init__(f'Unknown asset {asset_name} provided.')
class UnsupportedAsset(Exception):
def __init__(self, asset_name: str):
self.asset_name = asset_name
super().__init__(f'Found asset {asset_name} which is not supported.')
class HistoryCacheInvalid(Exception):
pass
class DBUpgradeError(Exception):
pass
class DeserializationError(Exception):
"""Raised when deserializing data from the outside and something unexpected is found"""
pass
class NoPriceForGivenTimestamp(Exception):
def __init__(self, from_asset, to_asset, timestamp):
super(NoPriceForGivenTimestamp, self).__init__(
'Unable to query a historical price for "{}" to "{}" at {}'.format(
from_asset, to_asset, timestamp,
),
)