nikhaldi / exception_notification-rake

Sends mail upon failures in Rake tasks
MIT License
39 stars 14 forks source link

ignore, ignore_if should work as configuration options #4

Closed wollkind closed 10 years ago

wollkind commented 10 years ago

Because of the way exception_notification-rake calls the notifier.deliver method directly, the options for ignore and ignore_if never take effect if specified in the en-rake config block. It would be nice if this could be fixed.

nikhaldi commented 10 years ago

Just making sure I understand the request. You'd like to specify ignore options like this:

ExceptionNotifier::Rake.configure( :ignore_if => lambda { |env, e| e.message =~ /^Couldn't find Page with ID=/ })

And similar for :ignore_exceptions and :ignore_crawlers, I assume (though I guess :ignore_crawlers is not particularly relevant for background jobs). Correct?

wollkind commented 10 years ago

Exactly. Sorry I wasn't more clear. However I'm also on 0.0.5 instead of 0.1.0 so I guess I'd have some updating to do before any change that gets made would even be usable by me. How hard is this to implement?

nikhaldi commented 10 years ago

It's pretty easy to do, I'll take a look. I have branches for the 0.0.x and 0.1.x, so I'd likely release this for both lines (0.0.x is only compatible with Rails 3.2, 0.1.x only with Rails 4.0).

nikhaldi commented 10 years ago

I pushed version 0.0.6 of the gem (for Rails 3.2) with this fix. Give it a try. I will also release a new version for Rails 4.0 soon.

nikhaldi commented 10 years ago

Version 0.1.1 also pushed (not actual changes to code, just tests verifying that the ignore options actually work)