I have the following Sinatra app and I am testing the error
block but it doesnt seem to be working.
Here's my sinatra app:
require 'rubygems'
require 'sinatra'
error do
puts "----> Failed"
$stdout.print "----> Failed"
end
get "/*" do
raise "Error!!"
end
I am using sinatra (1.3.3)
You can add:
set :show_exceptions, false
To your application file.
In development environments show_exceptions
is enabled by default.
Sinatra uses its own error handler when it is set in development
mode, which it is by default. For your error to show up you have to run your app in production
mode like this:
ruby my_app.rb -e production
Here's a link to the specific documentation for further reference: Sinatra README #Environments
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With