Skip to content
Snippets Groups Projects
Commit 994132a5 authored by Holger Just's avatar Holger Just
Browse files

[#604] Add nicer error formatting, similar to the old style

parent fe6a79ac
Tags
No related merge requests found
......@@ -4,9 +4,20 @@ module ChiliProject
module Context
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :handle_error, :formatting
end
end
module InstanceMethods
def handle_error_with_formatting(e)
error = handle_error_without_formatting(e)
escaped_error = registers[:view].send(:h, error) rescue CGI::escapeHTML(error)
html = '<div class="flash error">' + escaped_error + '</div>'
html_result(html)
end
def html_result(html)
key = nil
while key.nil? || html_results.has_key?(key)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment