changeset 1265:24e2973378f6

pages (login): fixed log error handling
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 11:02:31 +0200
parents 54d8b7357267
children 6b7f9c3558cc
files libervia/pages/login/page_meta.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/pages/login/page_meta.py	Mon May 04 10:18:58 2020 +0200
+++ b/libervia/pages/login/page_meta.py	Tue May 19 11:02:31 2020 +0200
@@ -74,8 +74,9 @@
             log.warning(f"login tentative with invalid profile: {login!r}")
             defer.returnValue(login_error(self, request, C.PROFILE_AUTH_ERROR))
         except ValueError as e:
-            if e.message in (C.XMPP_AUTH_ERROR, C.PROFILE_AUTH_ERROR):
-                defer.returnValue(login_error(self, request, e.message))
+            message = str(e)
+            if message in (C.XMPP_AUTH_ERROR, C.PROFILE_AUTH_ERROR):
+                defer.returnValue(login_error(self, request, message))
             else:
                 # this error was not expected!
                 raise e