mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Improve exception messages on credential mismatches (#1417)
This commit is contained in:
kasa/transports
@@ -214,8 +214,8 @@ class KlapTransport(BaseTransport):
|
||||
|
||||
if default_credentials_seed_auth_hash == server_hash:
|
||||
_LOGGER.debug(
|
||||
"Server response doesn't match our expected hash on ip %s, "
|
||||
"but an authentication with %s default credentials matched",
|
||||
"Device response did not match our expected hash on ip %s,"
|
||||
"but an authentication with %s default credentials worked",
|
||||
self._host,
|
||||
key,
|
||||
)
|
||||
@@ -235,13 +235,16 @@ class KlapTransport(BaseTransport):
|
||||
|
||||
if blank_seed_auth_hash == server_hash:
|
||||
_LOGGER.debug(
|
||||
"Server response doesn't match our expected hash on ip %s, "
|
||||
"but an authentication with blank credentials matched",
|
||||
"Device response did not match our expected hash on ip %s, "
|
||||
"but an authentication with blank credentials worked",
|
||||
self._host,
|
||||
)
|
||||
return local_seed, remote_seed, self._blank_auth_hash # type: ignore
|
||||
|
||||
msg = f"Server response doesn't match our challenge on ip {self._host}"
|
||||
msg = (
|
||||
f"Device response did not match our challenge on ip {self._host}, "
|
||||
f"check that your e-mail and password (both case-sensitive) are correct. "
|
||||
)
|
||||
_LOGGER.debug(msg)
|
||||
raise AuthenticationError(msg)
|
||||
|
||||
|
@@ -603,7 +603,10 @@ class SslAesTransport(BaseTransport):
|
||||
_LOGGER.debug("Credentials match")
|
||||
return local_nonce, server_nonce, pwd_hash
|
||||
|
||||
msg = f"Server response doesn't match our challenge on ip {self._host}"
|
||||
msg = (
|
||||
f"Device response did not match our challenge on ip {self._host}, "
|
||||
f"check that your e-mail and password (both case-sensitive) are correct. "
|
||||
)
|
||||
_LOGGER.debug(msg)
|
||||
|
||||
raise AuthenticationError(msg)
|
||||
|
Reference in New Issue
Block a user