Skip to content

Instantly share code, notes, and snippets.

@gonzedge
Created April 27, 2012 14:39
Show Gist options
  • Save gonzedge/2509778 to your computer and use it in GitHub Desktop.
Save gonzedge/2509778 to your computer and use it in GitHub Desktop.
Rails - Custom 404 and 500 pages and the exception_notification gem
class ApplicationController < ActionController::Base
# ...
private
# ...
def notify(exception)
ExceptionNotifier::Notifier.exception_notification(request.env, exception,
data: {message: 'an error happened'}).deliver
end
# ...
end
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