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
1 changed files with 7 additions and 3 deletions

View File

@ -114,9 +114,13 @@ def download(url):
except ValueError:
tools.warning("Invalid URL")
return False, None
except URLError:
tools.warning("Unable to get "+url+" using proxy "+proxy+". It " +
"may not be available.")
except (URLError, socket.error):
if proxy != "":
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
return False, None