Skip to content

Commit df69bce

Browse files
HarvsGfrenck
authored andcommitted
Pihole better logging of update errors (home-assistant#152077)
1 parent c75dca7 commit df69bce

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

homeassistant/components/pi_hole/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,16 @@ async def async_update_data() -> None:
129129
raise ConfigEntryAuthFailed
130130
except HoleError as err:
131131
if str(err) == "Authentication failed: Invalid password":
132-
raise ConfigEntryAuthFailed from err
133-
raise UpdateFailed(f"Failed to communicate with API: {err}") from err
132+
raise ConfigEntryAuthFailed(
133+
f"Pi-hole {name} at host {host}, reported an invalid password"
134+
) from err
135+
raise UpdateFailed(
136+
f"Pi-hole {name} at host {host}, update failed with HoleError: {err}"
137+
) from err
134138
if not isinstance(api.data, dict):
135-
raise ConfigEntryAuthFailed
139+
raise ConfigEntryAuthFailed(
140+
f"Pi-hole {name} at host {host}, returned an unexpected response: {api.data}, assuming authentication failed"
141+
)
136142

137143
coordinator = DataUpdateCoordinator(
138144
hass,

0 commit comments

Comments
 (0)