smartinez87/exception_notification — pull request #242 by chancancode (2014-10-23 21:00:41+00:00)
Title: Make backtrace cleaning optional

Hello!

This is a starting point to fix #228. It adds a new config `config.exception_notification.clean_backtrace` (defaults
to `true`) for changing whether backtraces should be cleaned.

Also fixed a bug where the backtrace of background exceptions are not ran through the backtrace cleaner currently – I'm unsure if this was intentional, but it was easier to "fix" this so that the test would pass. If that's unacceptable, feel free to pick it up from here and improve the code.

To maintain the current behavior, the new option is defaulted to `true`. However, personally, I feel that this whole feature (backtrace cleaning) is of dubious values in these exception emails. I came across this when helping a client debug an error they are encountering, but unfortunately the error is originated from a gem so I didn't have any backtrace to look at. It seems like you would always want to have more information in these reports... I'm not sure if there's much value in having the option to clean the backtrace in the first place in this context.

The backtrace cleaning code is also only used in the `EmailNotifier`, so if this is staying, it should probably be moved up one layer so that it would be consistent across the `WebhookNotifier` (for example) and the chat notifiers as well (in theory, the cleaner could remove some of the top frames in the backtrace as well).

Like I said, this is only a starting point, so if it doesn't fit your needs for some reason, feel free to pick it up and improve it or reimplement in another way. Would love to see this feature go into the master branch eventually!

Thanks in advance for your time reviewing this, hope it helps! :heart: :yellow_heart: :green_heart: :blue_heart: :purple_heart:

Fixes #228