From ce5d77cce2428d526c3c4d9b95f85ebc6b0c97c4 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 21 Oct 2011 19:34:12 -0200 Subject: [PATCH] Add section on README explaining :ignore_exceptions option. --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6550cac1..545fc696 100644 --- a/README.md +++ b/README.md @@ -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" }, + :exception_recipients => %w{exceptions@example.com}, + :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 ---