forked from smartinez87/exception_notification
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add section on README explaining :ignore_exceptions option.
- Loading branch information
1 parent
986f427
commit ce5d77c
Showing
1 changed file
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] ", | ||
|
@@ -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 | ||
--- | ||
|