Created
February 24, 2022 11:26
-
-
Save rj76/33dadfa799704168727f14bea490d58d to your computer and use it in GitHub Desktop.
Exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SalaryNotInRangeError(Exception): | |
"""Exception raised for errors in the input salary. | |
Attributes: | |
salary -- input salary which caused the error | |
message -- explanation of the error | |
""" | |
def __init__(self, salary, message="Salary is not in (5000, 15000) range"): | |
self.salary = salary | |
self.message = message | |
super().__init__(self.message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment