summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-01-24 02:45:28 -0800
committerLance Stout <lancestout@gmail.com>2013-01-24 02:45:28 -0800
commit1f137735e1d9c6e60dfa569646cebe1a015c3beb (patch)
tree1e6ac344c2b4a6385eba1fdc7b76e7b3c29fda28 /sleekxmpp
parenta186972f09db03c6e8dae2126ad86801cdc27d2f (diff)
downloadslixmpp-1f137735e1d9c6e60dfa569646cebe1a015c3beb.tar.gz
slixmpp-1f137735e1d9c6e60dfa569646cebe1a015c3beb.tar.bz2
slixmpp-1f137735e1d9c6e60dfa569646cebe1a015c3beb.tar.xz
slixmpp-1f137735e1d9c6e60dfa569646cebe1a015c3beb.zip
Put StringPrep exception handler with the right try block.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index 555d8fad..81b997eb 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -173,6 +173,9 @@ class FeatureMechanisms(BasePlugin):
self.xmpp.event("no_auth", direct=True)
self.attempted_mechs = set()
return self.xmpp.disconnect()
+ except StringPrepError:
+ log.exception("A credential value did not pass SASLprep.")
+ self.xmpp.disconnect()
resp = stanza.Auth(self.xmpp)
resp['mechanism'] = self.mech.name
@@ -189,9 +192,6 @@ class FeatureMechanisms(BasePlugin):
"A security breach is possible.")
self.attempted_mechs.add(self.mech.name)
self.xmpp.disconnect()
- except StringPrepError:
- log.exception("A credential value did not pass SASLprep.")
- self.xmpp.disconnect()
else:
resp.send(now=True)