]> git.cworth.org Git - sup/blobdiff - lib/sup/util.rb
Merge branch 'logging' into next
[sup] / lib / sup / util.rb
index 518866beff61e308319ccde80042cdb9c442d8a0..068ce6bad904c9012bdcd5d8883ac48a68e59976 100644 (file)
@@ -92,7 +92,7 @@ end
 
 class Range
   ## only valid for integer ranges (unless I guess it's exclusive)
-  def size 
+  def size
     last - first + (exclude_end? ? 0 : 1)
   end
 end
@@ -654,7 +654,7 @@ class Iconv
     begin
       Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2]
     rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::InvalidCharacter, Iconv::IllegalSequence => e
-      info "couldn't transcode text from #{charset} to #{target} (\"#{text[0 ... 20]}\"...)"
+      warn "couldn't transcode text from #{charset} to #{target} (\"#{text[0 ... 20]}\"...) (got #{e.message}); using original as is"
       text
     end
   end