From 328f8b799eb60163289dec1efe6389466f63d403 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Thu, 10 Nov 2022 15:06:24 -0700 Subject: [PATCH] commands/auth: add logging for login failures Signed-off-by: Sumner Evans --- linkedin_matrix/commands/auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linkedin_matrix/commands/auth.py b/linkedin_matrix/commands/auth.py index abb3a69..662f704 100644 --- a/linkedin_matrix/commands/auth.py +++ b/linkedin_matrix/commands/auth.py @@ -114,9 +114,10 @@ async def enter_password(evt: CommandEvent): "received via SMS or your authenticator app here." ) return - except Exception: + except Exception as e: + logging.exception("Failed to log in") evt.sender.command_status = None - await evt.reply("Failed to log in") + await evt.reply(f"Failed to log in: {e}") return # We were able to log in successfully without 2FA. @@ -132,6 +133,7 @@ async def enter_2fa_code(evt: CommandEvent): try: await client.enter_2fa("".join(evt.args).strip()) except Exception as e: + logging.exception("Failed to log in") evt.sender.command_status = None await evt.reply(f"Failed to log in: {e}")