1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 12:29:08 +00:00

Sentry only loaded when diagnostics on (#3993)

* Sentry only loaded when diagnostics on

* Logging when sentry is closed
This commit is contained in:
Mike Degatano
2022-11-13 15:23:52 -05:00
committed by GitHub
parent 14cd261b76
commit 14fcda5d78
47 changed files with 619 additions and 133 deletions

View File

@@ -10,7 +10,6 @@ from types import MappingProxyType
from typing import TYPE_CHECKING, Any, TypeVar
import aiohttp
import sentry_sdk
from .config import CoreConfig
from .const import ENV_SUPERVISOR_DEV, SERVER_SOFTWARE
@@ -514,10 +513,6 @@ class CoreSys:
"""Create an async task."""
return self.loop.create_task(coroutine)
def capture_exception(self, err: Exception) -> None:
"""Capture a exception."""
sentry_sdk.capture_exception(err)
class CoreSysAttributes:
"""Inherit basic CoreSysAttributes."""
@@ -692,7 +687,3 @@ class CoreSysAttributes:
def sys_create_task(self, coroutine: Coroutine) -> asyncio.Task:
"""Create an async task."""
return self.coresys.create_task(coroutine)
def sys_capture_exception(self, err: Exception) -> None:
"""Capture a exception."""
self.coresys.capture_exception(err)