summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-08-19 16:04:40 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-08-19 16:05:14 +0200
commit813a683892b80630c55a2c3aee69617e14071fa4 (patch)
treeaea9200888c5cfb87308d5edd59003e619f2de30 /bin
parentfd5239d6ba166225495c0cb7f29907ac73c595b9 (diff)
also catch url errors
Diffstat (limited to 'bin')
-rw-r--r--bin/updater.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/updater.py b/bin/updater.py
index f168c6aff..651ad1bc0 100644
--- a/bin/updater.py
+++ b/bin/updater.py
@@ -72,7 +72,8 @@ class UpdateThread(threading.Thread):
try:
opener = get_basic_auth_opener(url, self.user, self.password)
opener.open(url, timeout=self.timeout)
- except (urllib.error.HTTPError, socket.timeout) as e:
+ except (urllib.error.HTTPError, urllib.error.URLError,
+ socket.timeout) as e:
print('%s: %s' % (url, e))
@@ -126,7 +127,8 @@ class Updater:
# wait until the interval finished to run again
time.sleep(self.interval)
- except (ValueError, urllib.error.HTTPError) as e:
+ except (ValueError, urllib.error.HTTPError,
+ urllib.error.URLError) as e:
print('%s: %s' % (self.base_url, e))
print('Trying again in 30 seconds')
time.sleep(30)