re-raise missing template exception in dev
This commit is contained in:
parent
a66a0bb5a8
commit
22efdcfa44
|
@ -85,10 +85,8 @@ module Middleman
|
||||||
lookup = File.join(lookup, '*')
|
lookup = File.join(lookup, '*')
|
||||||
|
|
||||||
results = Dir[lookup].sort do |a, b|
|
results = Dir[lookup].sort do |a, b|
|
||||||
simple_a = a.gsub(Middleman::Server.root + "/", '')
|
simple_a = a.gsub(Middleman::Server.root + "/", '').gsub(Middleman::Server.views + "/", '')
|
||||||
.gsub(Middleman::Server.views + "/", '')
|
simple_b = b.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
|
a_dir = simple_a.split("/").first
|
||||||
b_dir = simple_b.split("/").first
|
b_dir = simple_b.split("/").first
|
||||||
|
|
|
@ -186,10 +186,14 @@ module Middleman
|
||||||
|
|
||||||
status 404
|
status 404
|
||||||
rescue Padrino::Rendering::TemplateNotFound
|
rescue Padrino::Rendering::TemplateNotFound
|
||||||
|
if settings.environment == :development
|
||||||
|
raise $!
|
||||||
|
else
|
||||||
$stderr.puts "File not found: #{request.path}"
|
$stderr.puts "File not found: #{request.path}"
|
||||||
status 404
|
status 404
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require "middleman/assets"
|
require "middleman/assets"
|
||||||
|
|
Loading…
Reference in a new issue