From 4591be379b02fb71931b93e978ed1c9971e66730 Mon Sep 17 00:00:00 2001 From: Mark Harrison Date: Sat, 5 Oct 2024 16:57:39 -0700 Subject: [PATCH] Catch exception from upgrade_to_bot_account() The call to Lichess.upgrade_to_bot_account() does not return a value. Failure is signaled by an exception. Fix the call to upgrade_account() in lib/lichess_bot.py to reflect this. --- lib/lichess_bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/lichess_bot.py b/lib/lichess_bot.py index 43868ed8b..3a220eb43 100644 --- a/lib/lichess_bot.py +++ b/lib/lichess_bot.py @@ -109,7 +109,10 @@ def signal_handler(signal: int, frame: Optional[FrameType]) -> None: def upgrade_account(li: LICHESS_TYPE) -> bool: """Upgrade the account to a BOT account.""" - if li.upgrade_to_bot_account() is None: + try: + li.upgrade_to_bot_account() + except HTTPError: + logger.exception("Failed to upgrade to Bot Account.") return False logger.info("Successfully upgraded to Bot Account!")