aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2017-02-12 12:27:45 +0000
committerEric S. Raymond <esr@thyrsus.com>2017-02-12 12:27:45 +0000
commit1d4026b2fed8ed133ae370a7267cfdda3e09b34e (patch)
treed0b1fc35063b0a154b37d55e6c1c808b231200ca
parentMerge branch 'feature/use_non-root_user_in_systemd' into 'master' (diff)
parentOnly HTTPError has a code attribute (diff)
downloadirker-1d4026b2fed8ed133ae370a7267cfdda3e09b34e.tar.xz
Merge branch 'master' into 'master'
Only HTTPError has a code attribute See merge request !14
-rwxr-xr-xirkerhook.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/irkerhook.py b/irkerhook.py
index 9768eac..ce19446 100755
--- a/irkerhook.py
+++ b/irkerhook.py
@@ -95,12 +95,14 @@ class Commit:
self.url = webview
else:
self.url = webview
- except IOError as e:
+ except urllib2.HTTPError as e:
if e.code == 401:
# Authentication error, so we assume the view is valid
self.url = webview
else:
self.url = ""
+ except IOError:
+ self.url = ""
res = self.template % self.__dict__
return unicode(res, 'UTF-8') if not isinstance(res, unicode) else res