Permalink
Browse files

Prevent app crash in case if encoding failed

  • Loading branch information...
1 parent 1b2068e commit cc8369144db2147d2956e8dd7d314e9a7dfd4fbb @randx randx committed May 22, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/gitlabhq/encode.rb
View
@@ -11,6 +11,10 @@ def utf8 message
else
message
end.force_encoding("utf-8")
+ # Prevent app from crash cause of
+ # encoding errors
+ rescue
+ ""
end
end
end

2 comments on commit cc83691

Contributor

zzjin replied May 22, 2012

yes although commits message shown in unknow char,but all 404/500 page goes working.Thanks very much~

Still have error 500 when encoding fails: issue #750 ArgumentError (invalid byte sequence in UTF-8) even with the fix.

Please sign in to comment.