I used this code in an earlier(1.2.6) version of sinatra
error 400..510 do |app|
do_something_with app.status
end
Here app.status is the numeric code, i.e. a number between 400 and 510 that will be used in the response.
With a recent (1.3.2) version, this no longer works – app is nil. I’ve looked at the documentation and tried env['sinatra.error'] but that appears to be nil as well.
Is this still possible?
Have you tried
response.status? You can probably call it with juststatusas I believe it’s a helper.