forked from Treasure-Me/Mentor-Test-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_exceptions.py
More file actions
36 lines (27 loc) · 1.12 KB
/
Copy pathcustom_exceptions.py
File metadata and controls
36 lines (27 loc) · 1.12 KB
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
"""
Custom Exceptions for Mastermind Game
Implement the following custom exception classes.
Each exception should include an appropriate error message.
"""
# TODO: Create the following custom exception classes:
# 1. InvalidColorError - raised when an invalid color is used
class InvalidColorError(Exception):
pass
# 2. InvalidLengthError - raised when an invalid length is provided
class InvalidLengthError(Exception):
pass
# 3. GameNotInitializedError - raised when game operations are attempted before initialization
class GameNotInitializedError(Exception):
pass
# 4. InvalidGuessError - raised when an invalid guess is made
class InvalidGuessError(Exception):
pass
# 5. InvalidScoreCalculationError - raised when score calculation receives invalid parameters
class InvalidScoreCalculationError(Exception):
pass
# 6. InvalidDifficultyError - raised when an invalid difficulty level is provided
class InvalidDifficultyError(Exception):
pass
# 7. InvalidCombinationError - raised when an invalid color combination is requested
class InvalidCombinationError(Exception):
pass