Search
We can customize our InvalidAgeException class to accept certain arguments just like a normal class.
InvalidAgeException
Our class will have age and error_message as mandatory fields. We have also modified the display message during the exception using __str__.
age
error_message
__str__