Broader Notion exception handling (#35265)

pull/35272/head
Aaron Bach 2020-05-05 13:56:32 -06:00 committed by GitHub
parent 9983c43697
commit 87d58a544b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -196,7 +196,14 @@ class Notion:
results = await asyncio.gather(*tasks.values(), return_exceptions=True)
for attr, result in zip(tasks, results):
if isinstance(result, NotionError):
_LOGGER.error("There was an error while updating %s: %s", attr, result)
_LOGGER.error(
"There was a Notion error while updating %s: %s", attr, result
)
continue
if isinstance(result, Exception):
_LOGGER.error(
"There was an unknown error while updating %s: %s", attr, result
)
continue
holding_pen = getattr(self, attr)