Rescue encoding error on controller level

This commit is contained in:
randx 2012-05-31 23:36:52 +03:00
parent a719bfc931
commit 17d4cac208
2 changed files with 10 additions and 0 deletions

View file

@ -9,6 +9,10 @@ class ApplicationController < ActionController::Base
render "errors/gitolite", :layout => "error"
end
rescue_from Encoding::CompatibilityError do |exception|
render "errors/encoding", :layout => "error", :status => 404
end
rescue_from ActiveRecord::RecordNotFound do |exception|
render "errors/not_found", :layout => "error", :status => 404
end

View file

@ -0,0 +1,6 @@
.alert-message.block-message.error
%h3 Encoding Error
%hr
%p
Page cant be loaded cause of encoding error