Tags: patch

It's due to a timeout raised inside Net::HTTP

/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': Connection timed out -
connect(2) (Errno::ETIMEDOUT)
        from /usr/lib/ruby/1.8/net/http.rb:560:in `open'
        from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
        from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
        from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
        from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
        from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
        from /usr/lib/ruby/1.8/net/http.rb:542:in `start'
        from /usr/lib/ruby/1.8/net/http.rb:1035:in `request'
        from /usr/lib/ruby/1.8/net/http.rb:772:in `get'
        from /usr/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:127:in
`fetchLyrics'
        from /usr/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:193
        from /usr/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:179:in 
`loop'
        from /usr/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:179


While we can't do anything about the site being unreachable, we can avoid
stopping the script (I don't see any good reason for that): the solution is
simply to handle Errno::ETIMEDOUT and gracefully warn the user.

Cheers
--- /usr/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb.ori	2009-05-07 19:22:02.000000000 +0200
+++ /usr/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb	2009-05-07 19:27:25.000000000 +0200
@@ -163,6 +163,8 @@
 
     rescue SocketError
         showLyrics( "" )
+    rescue Errno::ETIMEDOUT
+        showLyrics( "" )
 end
 
 

Reply via email to