summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/keymanager/nicknym.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/bitmask/keymanager/nicknym.py')
-rw-r--r--src/leap/bitmask/keymanager/nicknym.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/leap/bitmask/keymanager/nicknym.py b/src/leap/bitmask/keymanager/nicknym.py
index b585d112..cbc4e25d 100644
--- a/src/leap/bitmask/keymanager/nicknym.py
+++ b/src/leap/bitmask/keymanager/nicknym.py
@@ -22,7 +22,7 @@ import urllib
from twisted.internet import defer
from twisted.logger import Logger
from twisted.web import client
-from twisted.web._responses import NOT_FOUND, SERVICE_UNAVAILABLE
+from twisted.web._responses import NOT_FOUND, SERVICE_UNAVAILABLE, BAD_GATEWAY
from leap.bitmask.keymanager.errors import KeyNotFound
from leap.common.check import leap_assert
@@ -146,6 +146,11 @@ class Nicknym(object):
'Request: %s' % (response.code, uri)
self.log.warn(message)
raise KeyNotFound(message), None, sys.exc_info()[2]
+ if response.code == BAD_GATEWAY:
+ message = ' %s: Bad gateway. Request: %s. Response: %s' \
+ % (response.code, uri, response)
+ self.log.warn(message)
+ raise KeyNotFound(message), None, sys.exc_info()[2]
return response
d = self._async_client_pinned.request(str(uri), 'GET',