aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-24 11:28:05 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-24 11:28:05 +0100
commit58f69ba085542bf99ae6cdd34ddf62cb847aceed (patch)
tree9e92af0ce747d982cb40c7f2353a0c4134753385 /actionpack/lib
parentf32247cb3eb1a444e40a66c1ad6147fdac4392c7 (diff)
downloadrails-58f69ba085542bf99ae6cdd34ddf62cb847aceed.tar.gz
rails-58f69ba085542bf99ae6cdd34ddf62cb847aceed.tar.bz2
rails-58f69ba085542bf99ae6cdd34ddf62cb847aceed.zip
Remove Rescue middleware that was never used by Rails.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch.rb1
-rw-r--r--actionpack/lib/action_dispatch/middleware/rescue.rb26
2 files changed, 0 insertions, 27 deletions
diff --git a/actionpack/lib/action_dispatch.rb b/actionpack/lib/action_dispatch.rb
index bcb2ac8ffc..070ffbdceb 100644
--- a/actionpack/lib/action_dispatch.rb
+++ b/actionpack/lib/action_dispatch.rb
@@ -60,7 +60,6 @@ module ActionDispatch
autoload :PublicExceptions
autoload :Reloader
autoload :RemoteIp
- autoload :Rescue
autoload :ShowExceptions
autoload :Static
end
diff --git a/actionpack/lib/action_dispatch/middleware/rescue.rb b/actionpack/lib/action_dispatch/middleware/rescue.rb
deleted file mode 100644
index aee672112c..0000000000
--- a/actionpack/lib/action_dispatch/middleware/rescue.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-module ActionDispatch
- class Rescue
- def initialize(app, rescuers = {}, &block)
- @app, @rescuers = app, {}
- rescuers.each { |exception, rescuer| rescue_from(exception, rescuer) }
- instance_eval(&block) if block_given?
- end
-
- def call(env)
- @app.call(env)
- rescue Exception => exception
- if rescuer = @rescuers[exception.class.name]
- env['action_dispatch.rescue.exception'] = exception
- rescuer.call(env)
- else
- raise exception
- end
- end
-
- protected
- def rescue_from(exception, rescuer)
- exception = exception.class.name if exception.is_a?(Exception)
- @rescuers[exception.to_s] = rescuer
- end
- end
-end