Run Black and use exc_info in logger.error

This commit is contained in:
2022-12-05 13:13:47 +01:00
parent 25cee0c9df
commit 31524f5e00
4 changed files with 74 additions and 24 deletions

View File

@ -19,6 +19,8 @@ def set_hook_by_name(name: str, feed_url: str) -> None or HTTPException:
webhook_url = settings["webhooks"][name]
try:
reader.set_tag(feed_url, "webhook", webhook_url)
except ResourceNotFoundError as e:
logger.error(f"ResourceNotFoundError: {e}")
return HTTPException(status_code=500, detail=f"ResourceNotFoundError: Could not set webhook: {e}")
error_msg = f"ResourceNotFoundError: Could not set webhook: {e}"
logger.error(error_msg, exc_info=True)
return HTTPException(status_code=500, detail=error_msg)