Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/application_controller.rb4
-rw-r--r--app/views/errors/encoding.html.haml6
2 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index a96c59b6787..f311f8aee0d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -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
diff --git a/app/views/errors/encoding.html.haml b/app/views/errors/encoding.html.haml
new file mode 100644
index 00000000000..c5cd2dd5c8b
--- /dev/null
+++ b/app/views/errors/encoding.html.haml
@@ -0,0 +1,6 @@
+.alert-message.block-message.error
+ %h3 Encoding Error
+ %hr
+ %p
+ Page cant be loaded cause of encoding error
+