Created
December 16, 2013 23:17
-
-
Save Fivell/7996592 to your computer and use it in GitHub Desktop.
EmailExceptionNotification module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module EmailExceptionNotification | |
| def self.included(base) | |
| base.rescue_from StandardError, :with => :handle_exceptions | |
| end | |
| def handle_exceptions(e) | |
| deliver_exception(e) | |
| raise e | |
| end | |
| def deliver_exception(e) | |
| ErrorMail.error(e, self.request).deliver | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment