Rescue encoding error on controller level
This commit is contained in:
parent
a719bfc931
commit
17d4cac208
2 changed files with 10 additions and 0 deletions
|
@ -9,6 +9,10 @@ class ApplicationController < ActionController::Base
|
||||||
render "errors/gitolite", :layout => "error"
|
render "errors/gitolite", :layout => "error"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rescue_from Encoding::CompatibilityError do |exception|
|
||||||
|
render "errors/encoding", :layout => "error", :status => 404
|
||||||
|
end
|
||||||
|
|
||||||
rescue_from ActiveRecord::RecordNotFound do |exception|
|
rescue_from ActiveRecord::RecordNotFound do |exception|
|
||||||
render "errors/not_found", :layout => "error", :status => 404
|
render "errors/not_found", :layout => "error", :status => 404
|
||||||
end
|
end
|
||||||
|
|
6
app/views/errors/encoding.html.haml
Normal file
6
app/views/errors/encoding.html.haml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.alert-message.block-message.error
|
||||||
|
%h3 Encoding Error
|
||||||
|
%hr
|
||||||
|
%p
|
||||||
|
Page cant be loaded cause of encoding error
|
||||||
|
|
Loading…
Add table
Reference in a new issue