summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-11-05 15:15:34 -0300
committerTomás Touceda <chiiph@leap.se>2013-11-05 15:15:34 -0300
commitaaaa0e34add8d89bc4697b6af2dca56c78a70133 (patch)
tree3ba20d53688c784282793573454844e18b68edd1
parentf57c6788c306db597802ea6d3232116b8984f62f (diff)
parent5ae44d80876aa9c1e60280fbf437ee687d9bc3c8 (diff)
Merge remote-tracking branch 'ivan/bug/4358_unhandled-error-during-register' into develop
-rw-r--r--changes/bug-4358_handle-timeout-during-register1
-rw-r--r--src/leap/bitmask/crypto/srpregister.py6
-rw-r--r--src/leap/bitmask/gui/wizard.py7
3 files changed, 7 insertions, 7 deletions
diff --git a/changes/bug-4358_handle-timeout-during-register b/changes/bug-4358_handle-timeout-during-register
new file mode 100644
index 00000000..04c408f6
--- /dev/null
+++ b/changes/bug-4358_handle-timeout-during-register
@@ -0,0 +1 @@
+- Handle Timeout errors during register process. Closes #4358.
diff --git a/src/leap/bitmask/crypto/srpregister.py b/src/leap/bitmask/crypto/srpregister.py
index 5c0a8efc..e110df68 100644
--- a/src/leap/bitmask/crypto/srpregister.py
+++ b/src/leap/bitmask/crypto/srpregister.py
@@ -108,7 +108,8 @@ class SRPRegister(QtCore.QObject):
:rparam: (ok, request)
"""
- username = username.lower()
+ username = username.lower().encode('utf-8')
+ password = password.encode('utf-8')
salt, verifier = self._srp.create_salted_verification_key(
username,
@@ -140,8 +141,7 @@ class SRPRegister(QtCore.QObject):
verify=self._provider_config.
get_ca_cert_path())
- except (requests.exceptions.SSLError,
- requests.exceptions.ConnectionError) as exc:
+ except requests.exceptions.RequestExceptions as exc:
logger.error(exc.message)
ok = False
else:
diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py
index 6ba65410..8de5802e 100644
--- a/src/leap/bitmask/gui/wizard.py
+++ b/src/leap/bitmask/gui/wizard.py
@@ -226,9 +226,7 @@ class Wizard(QtGui.QWizard):
self._registration_finished)
threads.deferToThread(
- partial(register.register_user,
- username.encode("utf8"),
- password.encode("utf8")))
+ partial(register.register_user, username, password))
self._username = username
self._password = password
@@ -282,7 +280,8 @@ class Wizard(QtGui.QWizard):
old_username = self._username
self._username = None
self._password = None
- error_msg = self.tr("Unknown error")
+ error_msg = self.tr("Something has gone wrong. "
+ "Please try again.")
try:
content, _ = get_content(req)
json_content = json.loads(content)