summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2018-02-09 18:58:29 +0100
committerAhmad Sherif <me@ahmadsherif.com>2018-02-09 18:59:16 +0100
commit14bb839477cb55c6178bf99463b28ec4e687763f (patch)
tree815c4dcb3ff067bbdbddb77c40ce61314f4c9e99 /lib
parent721fab661de4a01c2d73e88bdd000dfe2e094ced (diff)
downloadgitlab-ce-fix/encoding-to-unsupported-encodings.tar.gz
Return a warning string if we try to encode to unsupported encodingfix/encoding-to-unsupported-encodings
Fixes gitlab-development-kit#321
Diffstat (limited to 'lib')
-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..154cf7335b1 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 =~ /unknown encoding name/
+
encoding = detect ? detect[:encoding] : "unknown"
"--broken encoding: #{encoding}"
end