-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.py
More file actions
36 lines (24 loc) · 870 Bytes
/
Copy patherrors.py
File metadata and controls
36 lines (24 loc) · 870 Bytes
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
class GridError(Exception):
"""
Error to raise if the game grid is wrong
"""
def __init__(self, message='The game grid is wrong'):
Exception.__init__(self, message)
class InvalidMove(Exception):
"""
Error to raise if an invalid move was made
"""
def __init__(self, message='An invalid move was made'):
Exception.__init__(self, message)
class InvalidInput(Exception):
"""
Error to raise if there is an error with the given input
"""
def __init__(self, message='There was an error with the given input'):
Exception.__init__(self, message)
class GameIsOver(Exception):
"""
Error to raise if the game is already over
"""
def __init__(self, message='The game is already over'):
Exception.__init__(self, message)