Catch socket.error exceptions as seen in issue #20

This commit is contained in:
Phyks 2014-11-04 21:51:44 +01:00
parent 0fb579a58c
commit 08f6b8846a

View File

@ -114,9 +114,13 @@ def download(url):
except ValueError: except ValueError:
tools.warning("Invalid URL") tools.warning("Invalid URL")
return False, None return False, None
except URLError: except (URLError, socket.error):
tools.warning("Unable to get "+url+" using proxy "+proxy+". It " + if proxy != "":
"may not be available.") proxy_txt = "using proxy "+proxy
else:
proxy_txt = "without using any proxy"
tools.warning("Unable to get "+url+" "+proxy_txt+". It " +
"may not be available at the moment.")
continue continue
return False, None return False, None