Skip to content

Commit d9d98c1

Browse files
author
Werner Pieterson
committed
Log provider error
1 parent 86cb1d6 commit d9d98c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

custom_components/load_shedding/config_flow.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Adds config flow for LoadShedding."""
2+
23
from __future__ import annotations
34

45
import logging
@@ -103,6 +104,7 @@ async def async_step_sepush(
103104
elif status_code == 500:
104105
errors["base"] = "sepush_500"
105106
else:
107+
_LOGGER.error("Unable to initialise SePush API: %s", err)
106108
errors["base"] = "provider_error"
107109
else:
108110
return await self.async_step_lookup_areas(user_input)
@@ -165,8 +167,9 @@ async def async_step_lookup_areas(
165167
results = await self.hass.async_add_executor_job(
166168
get_areas, provider, search_text
167169
)
168-
except ProviderError:
170+
except ProviderError as err:
169171
_LOGGER.debug("Provider error", exc_info=True)
172+
_LOGGER.error("Unable to initialise SePush API: %s", err)
170173
errors["base"] = "provider_error"
171174
else:
172175
self.areas = {}
@@ -317,6 +320,7 @@ async def async_step_sepush(
317320
elif status_code == 500:
318321
errors["base"] = "sepush_500"
319322
else:
323+
_LOGGER.error("Unable to initialise SePush API: %s", err)
320324
errors["base"] = "provider_error"
321325
else:
322326
self.api_key = api_key

0 commit comments

Comments
 (0)