sunlightlabs / scout

Government-wide search and notification website.
https://scout.sunlightfoundation.com
Other
50 stars 30 forks source link

Added Sentry as an option for exception handling #487

Closed konklone closed 10 years ago

konklone commented 10 years ago

This adds support for Sentry as an error handler. If the sentry option in config.yml is not provided, the app fall back to normal SMTP.

The logical fork is placed in a new method, Admin.exception, that accepts a source, exception, and arbitrary extra data to be included. If Sentry is configured, it will be used, otherwise it will use SMTP.

There is one other place where Sentry configuration is checked, in the web error handler. This will add some extra request-level information if not using Sentry. Otherwise, it omits them, because Sentry will do a better and more comprehensive job at it.