diff --git a/backend/web/login/login.py b/backend/web/login/login.py index 009781d8ff1409d772ed297858fc86b2fa0e5bc2..424767b3e98455004181b7d9d1ee4c02e28c518a 100644 --- a/backend/web/login/login.py +++ b/backend/web/login/login.py @@ -170,8 +170,13 @@ def login(): messages.append(message) + except ory_kratos_client.exceptions.ApiAttributeError as ex: + # This exception is expected when there are no messages + pass except Exception as ex: - current_app.logger.info("No messages in kratos flow to push to UI") + # An unkown exception happens, we log the error but continue as it + # only affects the messages part + current_app.logger.error("Unknown exception: " + str(ex)) if identity and not refresh: # We are already logged in, and don't need to refresh.