diff options
author | Yves Senn <yves.senn@gmail.com> | 2012-09-16 21:48:24 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@garaio.com> | 2012-09-17 18:16:41 +0200 |
commit | 370dcd99b7635f6a5075da73de27c6da59a8553b (patch) | |
tree | 04c90a966a3a64e4222594bd36ad35eced002457 /actionpack/lib/action_dispatch | |
parent | 3c48b32f6e4a00e5d3d5d24988710894b992fb21 (diff) | |
download | rails-370dcd99b7635f6a5075da73de27c6da59a8553b.tar.gz rails-370dcd99b7635f6a5075da73de27c6da59a8553b.tar.bz2 rails-370dcd99b7635f6a5075da73de27c6da59a8553b.zip |
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.rb | 6 |
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) |