Override Sinatra default NotFound error page
Is there a way to override the sinatra default NotFound error page ("Sinatra doesnt know this ditty")? I want sinatra to show only a plain string as "Method not found" when it does not found the proper route, but when I raise an 404 error from inside a route I want it to show the passed-in error message. Implementing the not_found block like this: not_found do 'Method not found.' end works, but its not a valid option since I want to be able to throw my own NotFound error messages from routes like this: get '/' do begin # some processing that can raise an exception if resource not found rescue