diff options
author | Robert Speicher <robert@gitlab.com> | 2018-02-09 22:01:16 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-02-09 22:01:16 +0000 |
commit | 498ade4801a822f8704390b10d178af9fe7987cb (patch) | |
tree | aa27ec6d4b301e98e5957c1e036318f0f05a799f /lib | |
parent | 97a59cb7ce2b0049093e0059ac29965f5c745dab (diff) | |
parent | 0d9107374a2caddea61351d2fd5ba619cb69df81 (diff) | |
download | gitlab-ce-498ade4801a822f8704390b10d178af9fe7987cb.tar.gz |
Merge branch 'fix/encoding-to-unsupported-encodings' into 'master'
Return a warning string if we try to encode to unsupported encoding
Closes gitlab-development-kit#321
See merge request gitlab-org/gitlab-ce!17038
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/encoding_helper.rb | 6 |
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 |