lib/egregious.rb in egregious-0.1.3 vs lib/egregious.rb in egregious-0.1.4
- old
+ new
@@ -17,10 +17,15 @@
else
status.to_i
end
end
+ def status_code(status)
+ Egregious.status_code(status)
+ end
+
+
# internal method that loads the exception codes
def self._load_exception_codes
# by default if there is not mapping they map to 500/internal server error
exception_codes = {
@@ -165,10 +170,10 @@
build_html_file_path(status) : build_html_file_path('500')}
end
end
def build_html_file_path(status)
- File.join(Rails.root, 'public', status + '.html')
+ File.join(Rails.root, 'public', "#{status_code(status)}.html")
end
def self.included(base)
base.class_eval do
rescue_from 'Exception' , :with => :egregious_exception_handler