smartinez87/exception_notification — pull request #160 by jweslley (2013-05-30 16:18:20+00:00)
Title: Exception catchers

The initial purpose of this branch was separate notification logic from the rack middleware, both implemented in ExceptionNotifier class. But things got very simpler and better. :bowtie:

### Changelog

- [x] split out rack middleware from exception notifier core
* Creates [ExceptionNotification::Rack](https://github.com/jweslley/exception_notification/blob/exception_catchers/lib/exception_notification/rack.rb) class which implements the rack middleware. Thus, it became easier to add others 'exception catchers' like [resque](https://github.com/jweslley/exception_notification/blob/exception_catchers/lib/exception_notification/resque.rb) and [sidekiq](https://github.com/jweslley/exception_notification/blob/exception_catchers/lib/exception_notification/sidekiq.rb). Because this change, now configuration must look like:

```ruby
config.middleware.use ExceptionNotification::Rack,
:email => {
:email_prefix => "[ERROR] ",
:sender_address => %{"notifier" },
:exception_recipients => %w{exceptions@example.com},
}
...
```

- [x] add resque support
* errors occurred in resque jobs can be automatically sent
- [x] add sidekiq support
* errors occurred in sidekiq jobs can be automatically sent
- [x] add rails engine
* automatically adds the rack middleware in rails applications
- [x] add Rails generator to create an [initializer file](https://github.com/jweslley/exception_notification/blob/exception_catchers/lib/generators/exception_notification/templates/exception_notification.rb)
- [ ] remove residual logic from the rack middleware
* avoid unexpected behavior when triggering exceptions manually (like this #159, which occurs because the crawler logic is present in the rack middleware)
- [ ] add logger to log when notifications cannot be shiped
- [ ] Update docs (README/Changelog)