Commit d8b65b46672824959e6f96d2c7b51d289b268247

Authored by Victor Costa
1 parent 6005549e

Fix the use of exception notification

Gemfile
... ... @@ -16,6 +16,7 @@ gem 'hpricot'
16 16 gem 'nokogiri'
17 17 gem 'rake', :require => false
18 18 gem 'rest-client'
  19 +gem 'exception_notification'
19 20  
20 21 # FIXME list here all actual dependencies (i.e. the ones in debian/control),
21 22 # with their GEM names (not the Debian package names)
... ...
Gemfile.lock
... ... @@ -62,6 +62,9 @@ GEM
62 62 diff-lcs (1.1.3)
63 63 erubis (2.7.0)
64 64 eventmachine (0.12.10)
  65 + exception_notification (4.0.1)
  66 + actionmailer (>= 3.0.4)
  67 + activesupport (>= 3.0.4)
65 68 fast_gettext (0.6.8)
66 69 ffi (1.0.11)
67 70 gherkin (2.4.21)
... ... @@ -167,6 +170,7 @@ DEPENDENCIES
167 170 daemons
168 171 dalli
169 172 database_cleaner
  173 + exception_notification
170 174 fast_gettext
171 175 hpricot
172 176 mocha
... ...
config/initializers/exception_notification.rb
1 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 8 end
... ...