Skip to content

Commit

Permalink
Add section on README explaining :ignore_exceptions option.
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinez87 committed Oct 21, 2011
1 parent 986f427 commit ce5d77c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can reorder the sections, or exclude sections completely, by altering the
ExceptionNotifier.sections variable. You can even add new sections that
describe application-specific data--just add the section's name to the list
(wherever you'd like), and define the corresponding partial.

#Example with two new added sections
Whatever::Application.config.middleware.use ExceptionNotifier,
:email_prefix => "[Whatever] ",
Expand Down Expand Up @@ -77,7 +77,24 @@ In the above case, @document and @person would be made available to the email
renderer, allowing your new section(s) to access and display them. See the
existing sections defined by the plugin for examples of how to write your own.
You can also choose to exclude the exception message from the subject, which is included by default.
Use :verbose_subject => false to exclude it.
Use _:verbose_subject => false_ to exclude it.

You can also ignore types of exceptions, which will make
ExceptionNotifier avoid sending notifications for the specified exception types.
To achieve that, you should use the _:ignore_exceptions_ option, like this:

#Example ignoring some exceptions
Whatever::Application.config.middleware.use ExceptionNotifier,
:email_prefix => "[Whatever] ",
:sender_address => %{"notifier" <[email protected]>},
:exception_recipients => %w{[email protected]},
:ignore_exceptions => %w{::ActionView::TemplateError} + ExceptionNotifier::Notifier.default_sections

The above will make ExceptionNotifier ignore a +TemplateError+
exception, plus the ones ignored by default.
By default, ExceptionNotifier ignores _ActiveRecord::RecordNotFound_,
_AbstractController::ActionNotFound_ and
_ActionController::RountingError_.

Background Notifications
---
Expand Down

0 comments on commit ce5d77c

Please sign in to comment.