Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log stacktrace for asyncio.CancelledError #73

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions custom_components/huesyncbox/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ async def _async_register(
_LOGGER.exception("Unknown Philips Hue Play HDMI Sync Box error occurred")
return False
except asyncio.CancelledError:
_LOGGER.debug("_async_register, %s", "asyncio.CancelledError")
_LOGGER.debug("_async_register, asyncio.CancelledError", exc_info=True)
cancelled = True
finally:
# Only gets cancelled when flow is removed, don't call things on flow after that
_LOGGER.debug("_async_register, %s, %s", "finally", cancelled)
_LOGGER.debug("_async_register, finally, %s", cancelled)
if not cancelled:
# Continue the flow after show progress when the task is done.
# To avoid a potential deadlock we create a new task that continues the flow.
Expand Down Expand Up @@ -252,6 +252,7 @@ async def async_step_link(self, user_input=None) -> FlowResult:
registered = self.link_task.result()
except asyncio.CancelledError:
# Was cancelled, so not registered
_LOGGER.debug("async_step_link, asyncio.CancelledError", exc_info=True)
pass
except asyncio.InvalidStateError:
# Was not done, so not registered, cancel it
Expand Down