Raise and exxeption

Why is there is a requirement to derive it from the base class and what are some use cases for it

Why is it of type class main?

Hey @rishabb0220_574491cc1db7c5b2,
There are many use cases for exception for example take a company who only hires people of age greater than 21 so if someone input age 18 it can give a user defined error that age cant be less than 21. Deriving it from base class is the only way to add some new exceptions to the base class so the new exception added can be raised when needed.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.