Created
June 16, 2011 19:06
-
-
Save erikpukinskis/1029983 to your computer and use it in GitHub Desktop.
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
# in ApplicationController: | |
unless Rails.application.config.consider_all_requests_local | |
rescue_from Exception, NoMethodError, :with => :render_500 | |
rescue_from ActiveRecord::RecordNotFound, | |
ActionController::RoutingError, | |
ActionController::UnknownController, | |
ActionController::UnknownAction, :with => :render_404 | |
end | |
private | |
def render_404(e) | |
log_error(e) | |
Exceptional::Catcher.handle_with_controller(e, self, request) | |
render :template => "site/404", :layout => 'application', :status => :not_found | |
end | |
def render_500(e) | |
log_error(e) | |
Exceptional::Catcher.handle_with_controller(e, self, request) | |
render :template => "site/500", :layout => 'application', :status => :internal_server_error | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment