Skip to content

Instantly share code, notes, and snippets.

@rj76
Created February 24, 2022 11:26
Show Gist options
  • Save rj76/33dadfa799704168727f14bea490d58d to your computer and use it in GitHub Desktop.
Save rj76/33dadfa799704168727f14bea490d58d to your computer and use it in GitHub Desktop.
Exception
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