A simple Rack application that renders exceptions in the given public path.
Methods
Attributes
[RW] | public_path |
Class Public methods
Instance Public methods
# File actionpack/lib/action_dispatch/middleware/public_exceptions.rb, line 10 10: def call(env) 11: status = env["PATH_INFO"][1..-1] 12: locale_path = "#{public_path}/#{status}.#{I18n.locale}.html" if I18n.locale 13: path = "#{public_path}/#{status}.html" 14: 15: if locale_path && File.exist?(locale_path) 16: render(status, File.read(locale_path)) 17: elsif File.exist?(path) 18: render(status, File.read(path)) 19: else 20: [404, { "X-Cascade" => "pass" }, []] 21: end 22: end