Concept Flow - Creating custom exception class
Define class extending Exception
Add constructors for message
Throw custom exception in code
Catch custom exception
Handle or print error message
End
First, define a new class that extends Exception, add constructors, then throw and catch it in your code.