Cleanup exception logging in Idasen Desk (#102617)

* Cleaup exception logging in Idasen Desk

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Re-add trace

* Remove uneeded exc_info

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
pull/102570/head^2
Abílio Costa 2023-10-26 23:53:35 +01:00 committed by GitHub
parent 3b2a849f77
commit 6b5f2a1349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -65,14 +65,12 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
desk = Desk(None, monitor_height=False)
try:
await desk.connect(discovery_info.device, auto_reconnect=False)
except AuthFailedError as err:
_LOGGER.exception("AuthFailedError", exc_info=err)
except AuthFailedError:
errors["base"] = "auth_failed"
except TimeoutError as err:
_LOGGER.exception("TimeoutError", exc_info=err)
except TimeoutError:
errors["base"] = "cannot_connect"
except BleakError as err:
_LOGGER.exception("BleakError", exc_info=err)
except BleakError:
_LOGGER.exception("Unexpected Bluetooth error")
errors["base"] = "cannot_connect"
except Exception: # pylint: disable=broad-except
_LOGGER.exception("Unexpected error")