mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add debug logging for unknown Notion errors (#76395)
* Add debug logging for unknown Notion errors * Remove unused constant * Code review
This commit is contained in:
parent
8ea9f975fd
commit
dc30d97938
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
import traceback
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from aionotion import async_get_client
|
from aionotion import async_get_client
|
||||||
@ -31,7 +33,6 @@ PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR]
|
|||||||
ATTR_SYSTEM_MODE = "system_mode"
|
ATTR_SYSTEM_MODE = "system_mode"
|
||||||
ATTR_SYSTEM_NAME = "system_name"
|
ATTR_SYSTEM_NAME = "system_name"
|
||||||
|
|
||||||
DEFAULT_ATTRIBUTION = "Data provided by Notion"
|
|
||||||
DEFAULT_SCAN_INTERVAL = timedelta(minutes=1)
|
DEFAULT_SCAN_INTERVAL = timedelta(minutes=1)
|
||||||
|
|
||||||
CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)
|
CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)
|
||||||
@ -75,6 +76,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
f"There was a Notion error while updating {attr}: {result}"
|
f"There was a Notion error while updating {attr}: {result}"
|
||||||
) from result
|
) from result
|
||||||
if isinstance(result, Exception):
|
if isinstance(result, Exception):
|
||||||
|
if LOGGER.isEnabledFor(logging.DEBUG):
|
||||||
|
LOGGER.debug("".join(traceback.format_tb(result.__traceback__)))
|
||||||
raise UpdateFailed(
|
raise UpdateFailed(
|
||||||
f"There was an unknown error while updating {attr}: {result}"
|
f"There was an unknown error while updating {attr}: {result}"
|
||||||
) from result
|
) from result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user