-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.py
31 lines (21 loc) · 829 Bytes
/
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
class InstrumentsError(Exception):
def __init__(self, filename):
self.filename = filename
def __str__(self):
return f"Error while reading {self.filename}"
class StrategyError(Exception):
def __init__(self, strategy_name):
self.strategy_name = strategy_name
def __str__(self):
return f"Strategy {self.strategy_name} is not found"
class CurrencyError(Exception):
def __init__(self, currency):
self.currency = currency
def __str__(self):
return f"Currency {self.currency} not found in portfolio"
class HandlerError(Exception):
def __init__(self, handler_name, error):
self.handler_name = handler_name
self.error = error
def __str__(self):
return f"Error with {self.handler_name} handler: {self.error}"