Created
April 27, 2012 14:39
-
-
Save gonzedge/2509778 to your computer and use it in GitHub Desktop.
Rails - Custom 404 and 500 pages and the exception_notification gem
This file contains 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
class ApplicationController < ActionController::Base | |
# ... | |
private | |
# ... | |
def notify(exception) | |
ExceptionNotifier::Notifier.exception_notification(request.env, exception, | |
data: {message: 'an error happened'}).deliver | |
end | |
# ... | |
end |
This file contains 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
class ApplicationController < ActionController::Base | |
# ... | |
private | |
def render_404(exception) | |
notify exception | |
# ... | |
end | |
def render_500(exception) | |
notify exception | |
# ... | |
end | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment