Commit d8b65b46672824959e6f96d2c7b51d289b268247
1 parent
6005549e
Exists in
master
and in
22 other branches
Fix the use of exception notification
Showing
3 changed files
with
11 additions
and
6 deletions
Show diff stats
Gemfile
| @@ -16,6 +16,7 @@ gem 'hpricot' | @@ -16,6 +16,7 @@ gem 'hpricot' | ||
| 16 | gem 'nokogiri' | 16 | gem 'nokogiri' |
| 17 | gem 'rake', :require => false | 17 | gem 'rake', :require => false |
| 18 | gem 'rest-client' | 18 | gem 'rest-client' |
| 19 | +gem 'exception_notification' | ||
| 19 | 20 | ||
| 20 | # FIXME list here all actual dependencies (i.e. the ones in debian/control), | 21 | # FIXME list here all actual dependencies (i.e. the ones in debian/control), |
| 21 | # with their GEM names (not the Debian package names) | 22 | # with their GEM names (not the Debian package names) |
Gemfile.lock
| @@ -62,6 +62,9 @@ GEM | @@ -62,6 +62,9 @@ GEM | ||
| 62 | diff-lcs (1.1.3) | 62 | diff-lcs (1.1.3) |
| 63 | erubis (2.7.0) | 63 | erubis (2.7.0) |
| 64 | eventmachine (0.12.10) | 64 | eventmachine (0.12.10) |
| 65 | + exception_notification (4.0.1) | ||
| 66 | + actionmailer (>= 3.0.4) | ||
| 67 | + activesupport (>= 3.0.4) | ||
| 65 | fast_gettext (0.6.8) | 68 | fast_gettext (0.6.8) |
| 66 | ffi (1.0.11) | 69 | ffi (1.0.11) |
| 67 | gherkin (2.4.21) | 70 | gherkin (2.4.21) |
| @@ -167,6 +170,7 @@ DEPENDENCIES | @@ -167,6 +170,7 @@ DEPENDENCIES | ||
| 167 | daemons | 170 | daemons |
| 168 | dalli | 171 | dalli |
| 169 | database_cleaner | 172 | database_cleaner |
| 173 | + exception_notification | ||
| 170 | fast_gettext | 174 | fast_gettext |
| 171 | hpricot | 175 | hpricot |
| 172 | mocha | 176 | mocha |
config/initializers/exception_notification.rb
| 1 | unless NOOSFERO_CONF['exception_recipients'].blank? | 1 | unless NOOSFERO_CONF['exception_recipients'].blank? |
| 2 | - require 'noosfero.rb' | ||
| 3 | - require 'exception_notification.rb' | ||
| 4 | - ExceptionNotifier.sender_address = "noreply@#{Noosfero.default_hostname}" | ||
| 5 | - ExceptionNotifier.email_prefix = "[Noosfero ERROR] " | ||
| 6 | - ExceptionNotifier.exception_recipients = NOOSFERO_CONF['exception_recipients'] | ||
| 7 | - ActionController::Base.send :include, ExceptionNotifiable | 2 | + Noosfero::Application.config.middleware.use ExceptionNotification::Rack, |
| 3 | + :email => { | ||
| 4 | + :sender_address => "noreply@#{Noosfero.default_hostname}", | ||
| 5 | + :email_prefix => "[Noosfero ERROR] ", | ||
| 6 | + :exception_recipients => NOOSFERO_CONF['exception_recipients'] | ||
| 7 | + } | ||
| 8 | end | 8 | end |