re-raise missing template exception in dev

This commit is contained in:
Thomas Reynolds 2011-06-27 12:33:21 -07:00
parent a66a0bb5a8
commit 22efdcfa44
2 changed files with 8 additions and 6 deletions

View file

@ -85,10 +85,8 @@ module Middleman
lookup = File.join(lookup, '*')
results = Dir[lookup].sort do |a, b|
simple_a = a.gsub(Middleman::Server.root + "/", '')
.gsub(Middleman::Server.views + "/", '')
simple_b = b.gsub(Middleman::Server.root + "/", '')
.gsub(Middleman::Server.views + "/", '')
simple_a = a.gsub(Middleman::Server.root + "/", '').gsub(Middleman::Server.views + "/", '')
simple_b = b.gsub(Middleman::Server.root + "/", '').gsub(Middleman::Server.views + "/", '')
a_dir = simple_a.split("/").first
b_dir = simple_b.split("/").first

View file

@ -186,8 +186,12 @@ module Middleman
status 404
rescue Padrino::Rendering::TemplateNotFound
$stderr.puts "File not found: #{request.path}"
status 404
if settings.environment == :development
raise $!
else
$stderr.puts "File not found: #{request.path}"
status 404
end
end
end
end