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:
authorAhmad Sherif <me@ahmadsherif.com>2018-02-09 20:58:29 +0300
committerAhmad Sherif <me@ahmadsherif.com>2018-02-10 00:19:43 +0300
commit0d9107374a2caddea61351d2fd5ba619cb69df81 (patch)
treee009d879bd291ab7a4d9a1c441d6dfed21b58918 /lib/gitlab/encoding_helper.rb
parent721fab661de4a01c2d73e88bdd000dfe2e094ced (diff)
Return a warning string if we try to encode to unsupported encoding
Fixes gitlab-development-kit#321
Diffstat (limited to 'lib/gitlab/encoding_helper.rb')
-rw-r--r--lib/gitlab/encoding_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/encoding_helper.rb b/lib/gitlab/encoding_helper.rb
index c0edcabc6fd..6659efa0961 100644
--- a/lib/gitlab/encoding_helper.rb
+++ b/lib/gitlab/encoding_helper.rb
@@ -28,9 +28,9 @@ module Gitlab
# encode and clean the bad chars
message.replace clean(message)
- rescue ArgumentError
- return nil
- rescue
+ rescue ArgumentError => e
+ return unless e.message.include?('unknown encoding name')
+
encoding = detect ? detect[:encoding] : "unknown"
"--broken encoding: #{encoding}"
end