Skip to content

Commit

Permalink
commands/auth: add logging for login failures
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Dec 10, 2022
1 parent 9c7ff2b commit 328f8b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linkedin_matrix/commands/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}")

Expand Down

0 comments on commit 328f8b7

Please sign in to comment.