Browse Source

Provide additional details when auth fails (#180)

J. Nick Koston 1 year ago
parent
commit
7fcdc15a60
1 changed files with 4 additions and 2 deletions
  1. 4 2
      switchbot/devices/lock.py

+ 4 - 2
switchbot/devices/lock.py

@@ -107,10 +107,12 @@ class SwitchbotLock(SwitchbotDevice):
                 },
             )
         except cognito_idp_client.exceptions.NotAuthorizedException as err:
-            raise SwitchbotAuthenticationError("Failed to authenticate") from err
+            raise SwitchbotAuthenticationError(
+                f"Failed to authenticate: {err}"
+            ) from err
         except Exception as err:
             raise SwitchbotAuthenticationError(
-                "Unexpected error during authentication"
+                f"Unexpected error during authentication: {err}"
             ) from err
 
         if (