-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexceptions.py
56 lines (41 loc) · 1.85 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
#
# @file <exceptions.py>
#
# @author Fernando Mendiburu - <[email protected]>
#
class BrowserImplementationException(Exception):
def __init__(self, browser_name, message="Please implement this browser!"):
self.browser_name = browser_name
self.message = message
super().__init__(f'\n{message}')
def __str__(self):
return f'\n{self.message}\nBrowser: {self.browser_name}'
class NoPossibleTripException(Exception):
def __init__(self, message="Unable to find a route!"):
super().__init__(f'\n{message}')
class RepeatLoopException(Exception):
def __init__(self, description, message="Error getting the information from Google maps!"):
self.message = message
self.description = description
super().__init__(f'\n{message}')
def __str__(self):
return f'\n{self.message}:' \
f'\n{self.description}'
class ParametersIncompletedException(Exception):
def __init__(self, args, message="Parameters are not completed!"):
self.arguments = args
self.message = message
super().__init__(f'\n{self.message}')
def __str__(self):
return f'\n{self.message} -> ' \
f'\nCurrent place: {self.arguments.current}' \
f'\nDestination place: {self.arguments.destination} ' \
f'\nAllocate time: {self.arguments.time}'
class ParametersFormatException(Exception):
def __init__(self, message="Parameters time (duration) with a format error!"):
super().__init__(f'\n{message}')
#-------------------------------------------------------------------------------------------
#------------------------------------------Main---------------------------------------------
#-------------------------------------------------------------------------------------------
if __name__ == '__main__':
pass