Explorar el Código

Provide additional details when auth fails (#180)

J. Nick Koston hace 2 años
padre
commit
7fcdc15a60
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  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 (