From 4f78359cb1cdd5b544aa6eccb1475563394b7385 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 18 Feb 2017 11:06:45 +0700 Subject: Don't log a crash if the error is TokenError Bump version to 3.5 --- modules/mod_prs_main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/mod_prs_main.py b/modules/mod_prs_main.py index 9c9da11..858f4e6 100644 --- a/modules/mod_prs_main.py +++ b/modules/mod_prs_main.py @@ -22,12 +22,14 @@ def initializeUser(source, resource, prs): user.connect() except RuntimeError: pass - except Exception: + except Exception as e: + if not isinstance(e, TokenError): + report(crashLog("user.connect")) sendMessage(source, TransportID, _("Auth failed! If this error repeated, " "please register again." " This incident will be reported.\nCause: %s") % returnExc()) - report(crashLog("user.connect")) + logger.error("Failed to authenicate user! Error: %s (jid: %s)", e.message, source) else: user.initialize(send=True, resource=resource) # probably we need to know resource a bit earlier than this time utils.runThread(executeHandlers, ("prs01", (source, prs))) -- cgit v1.2.3