I started writing a simple Sinatra app today and I am trying to understand the error reporting but for some reason I can't get it to work correctly.
I know here, http://railsapi.com/doc/sinatra-v1.0/, it talks about working with error reporting/handling but when I run their examples I can't get it to work.
require 'sinatra'
error 400..510 do
'Boom'
end
get '/say/*' do
params[:splat]
end
When I run the app on my computer I get a 404 error code, but the 'Boom' text does not display in the browser, just the browser 404 page. I am sure I am doing something wrong, but just can't figure it out.
I will wager its your browser. On my MacBook Pro:
Chrome "helpfully" displays a "Oops! This link appears to be broken." page.
Safari displays the expected Boom text.
Firefox displays the expected Boom text.
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