-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ExceptionNotification via generator generated code
Ensure that FoodsoftConfig is loaded before running the initalizers. This also enables notifaction for Resque.
- Loading branch information
Showing
4 changed files
with
59 additions
and
28 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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Initial load the default config and database from rails environment | ||
# See config/app_config.yml for further details | ||
# Load Config, start by selecting defaults via current environment | ||
require 'foodsoft_config' | ||
FoodsoftConfig.init |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
require 'exception_notification/rails' | ||
|
||
|
||
require 'resque/failure/multiple' | ||
require 'resque/failure/redis' | ||
require 'exception_notification/resque' | ||
|
||
Resque::Failure::Multiple.classes = [Resque::Failure::Redis, ExceptionNotification::Resque] | ||
Resque::Failure.backend = Resque::Failure::Multiple | ||
|
||
|
||
ExceptionNotification.configure do |config| | ||
# Ignore additional exception types. | ||
# ActiveRecord::RecordNotFound, Mongoid::Errors::DocumentNotFound, AbstractController::ActionNotFound and ActionController::RoutingError are already added. | ||
# config.ignored_exceptions += %w{ActionView::TemplateError CustomError} | ||
|
||
# Adds a condition to decide when an exception must be ignored or not. | ||
# The ignore_if method can be invoked multiple times to add extra conditions. | ||
config.ignore_if do |exception, options| | ||
not Rails.env.production? | ||
end | ||
|
||
# Notifiers ================================================================= | ||
|
||
# Email notifier sends notifications by email. | ||
if notification = FoodsoftConfig[:notification] | ||
config.add_notifier :email, { | ||
:email_prefix => notification[:email_prefix], | ||
:sender_address => notification[:sender_address], | ||
:exception_recipients => notification[:error_recipients], | ||
} | ||
end | ||
|
||
# Campfire notifier sends notifications to your Campfire room. Requires 'tinder' gem. | ||
# config.add_notifier :campfire, { | ||
# :subdomain => 'my_subdomain', | ||
# :token => 'my_token', | ||
# :room_name => 'my_room' | ||
# } | ||
|
||
# HipChat notifier sends notifications to your HipChat room. Requires 'hipchat' gem. | ||
# config.add_notifier :hipchat, { | ||
# :api_token => 'my_token', | ||
# :room_name => 'my_room' | ||
# } | ||
|
||
# Webhook notifier sends notifications over HTTP protocol. Requires 'httparty' gem. | ||
# config.add_notifier :webhook, { | ||
# :url => 'http://example.com:5555/hubot/path', | ||
# :http_method => :post | ||
# } | ||
|
||
end |
This file was deleted.
Oops, something went wrong.