From: Anthoine Bourgeois Date: Wed, 21 Jul 2010 06:02:09 +0000 (+0200) Subject: lyrics/leoslyrics: don't print backtrace on HTTP failure X-Git-Tag: release-0.18~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=63e1f00207dcb519a1ff90a8d5afb44242f55847;p=ncmpc.git lyrics/leoslyrics: don't print backtrace on HTTP failure --- diff --git a/lyrics/30-leoslyrics.py b/lyrics/30-leoslyrics.py index 2a40f37..87953e8 100755 --- a/lyrics/30-leoslyrics.py +++ b/lyrics/30-leoslyrics.py @@ -43,7 +43,11 @@ def search(artist, title): 'artist': artist, 'songtitle': title}) url = "http://api.leoslyrics.com/api_search.php?" + query - f = urlopen(url) + try: + f = urlopen(url) + except IOError: + stderr.write("Failed to connect to http://api.leoslyrics.com, it seems down!\n") + exit(1) handler = SearchContentHandler() parser = make_parser() parser.setContentHandler(handler)