mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Catch KeyError
; Add response.text
to error message
This commit is contained in:
parent
66a63b983e
commit
2d5da3e958
@ -195,8 +195,9 @@ class Tplink3DeviceScanner(TplinkDeviceScanner):
|
|||||||
self.sysauth = regex_result.group(1)
|
self.sysauth = regex_result.group(1)
|
||||||
_LOGGER.info(self.sysauth)
|
_LOGGER.info(self.sysauth)
|
||||||
return True
|
return True
|
||||||
except ValueError:
|
except (ValueError, KeyError) as e:
|
||||||
_LOGGER.error("Couldn't fetch auth tokens!")
|
_LOGGER.error("Couldn't fetch auth tokens!"
|
||||||
|
"Response was: {}".format(response.text))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_SCANS)
|
@Throttle(MIN_TIME_BETWEEN_SCANS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user