aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-16 09:45:14 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-16 10:45:59 +0100
commit7dd1c751f90858cbdfaebeafed5fdf1ef400ae8b (patch)
tree2b1ce586925782ed1a8154737c325825b5b52d85 /actionpack/lib/action_dispatch
parent02127e64061fc61868f085102277ac5b679e0f75 (diff)
downloadrails-7dd1c751f90858cbdfaebeafed5fdf1ef400ae8b.tar.gz
rails-7dd1c751f90858cbdfaebeafed5fdf1ef400ae8b.tar.bz2
rails-7dd1c751f90858cbdfaebeafed5fdf1ef400ae8b.zip
Improve the specs on exceptions app.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/middleware/show_exceptions.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
index 4cfcb0a7db..5323048d90 100644
--- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -4,7 +4,12 @@ require 'active_support/deprecation'
module ActionDispatch
# This middleware rescues any exception returned by the application
- # and wraps them in a format for the end user.
+ # and calls a rack application that will wrap it in a format for the end user.
+ #
+ # The rack application should be passed as parameter on initialization
+ # of ShowExceptions. Everytime there is an exception, ShowExceptions will
+ # store the exception in env["action_dispatch.exception"], rewrite the
+ # PATH_INFO to the exception status code and call the rack app.
class ShowExceptions
FAILSAFE_RESPONSE = [500, {'Content-Type' => 'text/html'},
["<html><body><h1>500 Internal Server Error</h1>" <<