Exception notifier and rails 2.3, does it work?


#1

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)
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?


#2

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


#3

On 1 Mag, 02:23, Andrew B. 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


#4

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)
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