aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-17 09:21:23 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-17 09:21:23 -0700
commit8f0d332af385e1bbd931388f7c103b4743938a29 (patch)
treeecbd10670d4728bbb67da64c148c489d2391f2dd /actionpack/lib/action_dispatch
parent3c48b32f6e4a00e5d3d5d24988710894b992fb21 (diff)
parentdadfa9ab32669cda34f01a1cc06afbe97c8a0f79 (diff)
downloadrails-8f0d332af385e1bbd931388f7c103b4743938a29.tar.gz
rails-8f0d332af385e1bbd931388f7c103b4743938a29.tar.bz2
rails-8f0d332af385e1bbd931388f7c103b4743938a29.zip
Merge pull request #7660 from senny/7646_wrong_status_code_on_not_found
log 404 status when ActiveRecord::RecordNotFound was raised (#7646)
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/middleware/exception_wrapper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
index 7349b578d2..ae38c56a67 100644
--- a/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
+++ b/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
@@ -37,7 +37,7 @@ module ActionDispatch
end
def status_code
- Rack::Utils.status_code(@@rescue_responses[@exception.class.name])
+ self.class.status_code_for_exception(@exception.class.name)
end
def application_trace
@@ -52,6 +52,10 @@ module ActionDispatch
clean_backtrace(:all)
end
+ def self.status_code_for_exception(class_name)
+ Rack::Utils.status_code(@@rescue_responses[class_name])
+ end
+
private
def original_exception(exception)