Exception_notification plugin not sending mails in developme


#1

Hi everyone,

So, I’ve got exception_notification working now, but not in
development mode on localhost. In my ApplicationController, I’ve
added:

local_addresses.clear

Shouldn’t that be enough?

Thank you!

Sean


#2

Another update–I really can’t get it to send exceptions at all, and
I’m not sure why. For instance, I’m forcing a LDAP::ResultError
exception, but no mail is sent. I’ve even cleared out the addresses
array in local_addresses.

What I’d like to do is to use exception_notification within a rescue
clause. For instance:

begin

some stuff ehre

rescue Exception => ex

Send an email

Other operations to handle the rescue.

end

Am I barking up the wrong tree with this plugin?

Thanks!

Sean


#3

To send exception emails in dev mode, you need to be sure and change
the following line in config/environments/development.rb:

config.action_controller.consider_all_requests_local = true

Set that value to false. Otherwise, regardless of how you set
local_addresses, all requests are considered local.

Hope that helps,

Jamis


#4

It certainly does! Thank you!

Now, when I hit other types of exceptions (in one case, an LDAP
exception), I get this error:

NameError

uninitialized constant ExceptionNotifiable
RAILS_ROOT: /Users/sean/Projects/Rails/MagicHat/public/…/config/…

Application Trace | Framework Trace | Full Trace
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in
const_missing' /Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:inconst_missing’
/Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
`const_missing’
#{RAILS_ROOT}/app/controllers/application.rb:4
This error occured while loading the following files:
application.rb
exception_notifiable.rb

Thoughts on that one? Does this handle non-Rails exceptions? I have
“include ExceptionNotifiable” in my application.rb.

Thanks!

Sean