Skip to content

Commit

Permalink
Update and fixup ShowExceptions documentation
Browse files Browse the repository at this point in the history
This commit adds documentation to ShowExceptions explaining how it
should be configured in Rails applications. In addition, it adds more
`<code>` blocks to fix the formatting of some code snippets and prevent
the page from linking to itself.
  • Loading branch information
skipkayhil committed May 16, 2023
1 parent d137b10 commit 781a4a0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions actionpack/lib/action_dispatch/middleware/show_exceptions.rb
Expand Up @@ -8,14 +8,17 @@ module ActionDispatch
# This middleware rescues any exception returned by the application
# and calls an exceptions app that will wrap it in a format for the end user.
#
# The exceptions app should be passed as parameter on initialization
# of ShowExceptions. Every time 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.
# The exceptions app should be passed as a parameter on initialization of
# +ShowExceptions+. Every time there is an exception, +ShowExceptions+ will
# store the exception in <tt>env["action_dispatch.exception"]</tt>, rewrite
# the +PATH_INFO+ to the exception status code and call the Rack app.
#
# If the application returns a "X-Cascade" pass response, this middleware
# will send an empty response as result with the correct status code.
# If any exception happens inside the exceptions app, this middleware
# In \Rails applications, the exceptions app can be configured with
# +config.exceptions_app+, which defaults to ActionDispatch::PublicExceptions.
#
# If the application returns an <tt>"X-Cascade" => "pass"</tt> response, this
# middleware will send an empty response as a result with the correct status
# code. If any exception happens inside the exceptions app, this middleware
# catches the exceptions and returns a failsafe response.
class ShowExceptions
def initialize(app, exceptions_app)
Expand Down

0 comments on commit 781a4a0

Please sign in to comment.