Exception Notification plugin not working with Rails 2.1?

74 views
Skip to first unread message

Trevor Turk

unread,
Jun 4, 2008, 5:49:15 PM6/4/08
to Ruby on Rails: Core
We seemed to stop getting exception notifications in an app that's
using Rails 2.1 recently, and I did some digging to try and figure out
what the problem was. I think I'm onto the issue, but it would appear
that my Ruby-fu is still too weak to find a solution just yet.

Here's a failing test with the plugin in a fresh Rails 2.1 app:

http://pastie.org/208968

I think it may be related to this commit, but I'm not sure:

http://github.com/rails/rails/commit/8d37bd08eeac6d0e94f76ac6640e288bf64595b2

Thanks to github for the awesome search feature :)

http://github.com/rails/rails/search?q=filter_parameters&choice=grep

I think that making filter_parameters protected caused the issue
somewhere around here:

http://github.com/rails/exception_notification/tree/master/lib/exception_notifier_helper.rb#L64

That might be causing this test to fail:

http://github.com/rails/exception_notification/tree/master/test/exception_notifier_helper_test.rb#L46

Any help would be appreciated!

Thanks,
- Trevor

Michael Koziarski

unread,
Jun 4, 2008, 7:32:03 PM6/4/08
to rubyonra...@googlegroups.com
> Any help would be appreciated!

If it's just about making the method protected you should be able to change:

@controller.filter_parameters(parameters)

to

@controller.send(:filter_parameters, parameters)


--
Cheers

Koz

Trevor Turk

unread,
Jun 5, 2008, 1:44:39 PM6/5/08
to Ruby on Rails: Core
On Jun 4, 6:32 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:
> If it's just about making the method protected you should be able to change:
> @controller.filter_parameters(parameters)
> to
> @controller.send(:filter_parameters, parameters)

Thanks for your reply, Koz. This strategy you suggested appears to fix
the issue of the plugin not sending emails when exceptions are raised
in an app using Rails 2.1:

http://github.com/trevorturk/exception_notification/commit/9b3b0eca97ca27af6844ffc81ee6190ce022b364

Perhaps someone with commit access to the Rails github would consider
making this change in the official plugin?

Here is a ticket about the issue of the plugin not being compatible
with Rails 2.1:
http://rails.lighthouseapp.com/projects/8995/tickets/15-rails-2-1-0-filter_parameter_logging-crashes-exception_notifiable

Here is a ticket about the (separate?) issue of the (still) failing
test:
http://rails.lighthouseapp.com/projects/8995/tickets/11-exception_notifiable-test-failure

===
Just to be clear for others that may be impacted by this issue: the
exception_notification plugin does not appear to work with Rails 2.1
applications!
===

Thanks again,
- Trevor

tshim

unread,
Jul 2, 2008, 6:43:29 PM7/2/08
to Ruby on Rails: Core

I'm just chiming in to confirm this bug and the suggested fix -- but
shouldn't this be tracked as an exception_notifier bug, not a rails
bug?

Yong Bakos

unread,
Jul 2, 2008, 7:07:20 PM7/2/08
to Ruby on Rails: Core
After the above mentioned fix you may find another error.


Also fixed similarly as above, this time on exception_notifier_helper
line 76:

From:

return @controller.filter_parameters({env_key => env_value}).values[0]

To:

return @controller.send(:filter_parameters, {env_key =>
env_value}).values[0]

I've added this info to the lighthouse ticket:
http://rails.lighthouseapp.com/projects/8995-rails-plugins/tickets/15


Reply all
Reply to author
Forward
0 new messages