make not_found also trigger on NotFound exception directly, fixes #500

This commit is contained in:
Konstantin Haase 2013-02-26 16:02:18 +11:00
parent a51beb0346
commit c9c0e552ed
1 changed files with 2 additions and 1 deletions

View File

@ -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.