From c9c0e552ed7f20efc9e9b62fbe00d006fbd455ec Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 26 Feb 2013 16:02:18 +1100 Subject: [PATCH] make not_found also trigger on NotFound exception directly, fixes #500 --- lib/sinatra/base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index d166980c..ed5d4ebd 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -1180,7 +1180,8 @@ module Sinatra # Sugar for `error(404) { ... }` def not_found(&block) - error 404, &block + error(404, &block) + error(Sinatra::NotFound, &block) end # Define a named template. The block must return the template source.