# Exception notifier and rails 2.3, does it work?

**URL:** <https://www.ruby-forum.com/t/exception-notifier-and-rails-2-3-does-it-work/166906>\
**Category:** Rails\
**Created:** [April 30, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/exception-notifier-and-rails-2-3-does-it-work/166906 "2009-04-30T20:25:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [April 30, 2009, 8:25pm UTC](https://www.ruby-forum.com/t/exception-notifier-and-rails-2-3-does-it-work/166906/1 "2009-04-30T20:25:58Z")

</div>

Hi, i’ve just installed exception notifier, set in the enviroment.rb  
(i’ve tried also in an inizializer file and in production.rb in the  
enviroments folder)

ExceptionNotifier.exception\_recipients = %w(removed\_email\_address@domain.invalid)  
ExceptionNotifier.sender\_address = %(“Application Error” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid))  
ExceptionNotifier.email\_prefix = "[ERROR] "

and in the application controller

include ExceptionNotifiable  
local\_addresses.clear (i’ve tried with and without this)

deployed the app online with apache+passenger in production env, i  
went to a page which thrown an error, but i didn’t got any email. The  
app itself can send emails (i use postfix, and for other emails from  
the same app it works)

Any idea why it doesn’t work?

---

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [May 1, 2009, 2:23am UTC](https://www.ruby-forum.com/t/exception-notifier-and-rails-2-3-does-it-work/166906/2 "2009-05-01T02:23:48Z")

</div>

Very strange. Have you checked postfix at all? I use ExceptionNotifier  
in 2.3 with no problems at all.

---

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [May 1, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/exception-notifier-and-rails-2-3-does-it-work/166906/3 "2009-05-01T17:13:07Z")

</div>

On 1 Mag, 02:23, Andrew B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Very strange. Have you checked postfix at all? I use ExceptionNotifier  
> in 2.3 with no problems at all.

yep, there nothing in the log, as rails never pass it to send the mail  
at the moment of the error (a simple find with a wrong id which thrown  
an exception not catched), neither in the production.log (i don’t know  
if the plugin notify in the log when it send an email, btw there is  
nothing). Other emails works without problem both from the website and  
directly from the console

---

<div class="post-metadata">

**Author:** ![mix](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/919ad9/32.png) [@mix](https://www.ruby-forum.com/u/mix)\
**Post date:** [May 2, 2009, 1:24am UTC](https://www.ruby-forum.com/t/exception-notifier-and-rails-2-3-does-it-work/166906/4 "2009-05-02T01:24:33Z")

</div>

I’m seeing a similar problem, which started happening around the time  
we upgraded to Rails 2.3.

Have you tried logging into the console, and doing…

> > ExceptionNotifier.exception\_recipients  
> > =\> []

That is what mine looks like. I.e., the recipients are gone.  
However, I fixed this by changing my configuration (for example, in  
production.rb) to this…

config.after\_initialize do  
ExceptionNotifier.exception\_recipients = %w(removed\_email\_address@domain.invalid)  
ExceptionNotifier.sender\_address = %(“Application Error”  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid))  
end

I suspect that there is a better way to do this, specifically using  
rails initializers. However, it’s late on a Friday, and this fix will  
do until after railsconf (it’s bad enough pushing this change out to  
production on Friday afternoon ;)).

I hope that helps.  
Darren
