Skip to content

Commit

Permalink
catch urllib2.URLError when downloading media
Browse files Browse the repository at this point in the history
  • Loading branch information
wilddom committed Mar 28, 2016
1 parent 7c5b025 commit 6eb2c12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Memrise_Course_Importer/importer.py
Expand Up @@ -108,7 +108,7 @@ def download(self, url):
while True:
try:
return self.memriseService.downloadMedia(url, skipExisting=self.skipExistingMedia)
except urllib2.HTTPError as e:
except (urllib2.HTTPError, urllib2.URLError) as e:
if callable(self.askerFunction) and hasattr(self.askerFunction, '__self__'):
action = QMetaObject.invokeMethod(self.askerFunction.__self__, self.askerFunction.__name__, Qt.BlockingQueuedConnection, Q_RETURN_ARG(str), Q_ARG(str, url), Q_ARG(str, str(e)), Q_ARG(str, url))
if action == "ignore":
Expand Down

0 comments on commit 6eb2c12

Please sign in to comment.