Creating the Exception class
To create our “PersonalException” we just need to extend “Exception” class.
class PersonalException < Exception
end
Raise our Exception
raise PersonalException.new, "message"
Rescue our exception
We can do this by overwriting rescue_action_in_public and local_request? functions to our application.rb file:

