mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 19:16:29 +00:00
Avoid stack traces for known advanced logs errors
Known advanced errors, like connection reset, should not lead to stack traces in the Supervisor logs. Let those errors bubble up to the API error handling. Fixes: #5606
This commit is contained in:
parent
84b265a2e0
commit
3a00a6a9f2
@ -9,7 +9,7 @@ from aiohttp import web
|
|||||||
|
|
||||||
from ..const import AddonState
|
from ..const import AddonState
|
||||||
from ..coresys import CoreSys, CoreSysAttributes
|
from ..coresys import CoreSys, CoreSysAttributes
|
||||||
from ..exceptions import APIAddonNotInstalled, HostNotSupportedError
|
from ..exceptions import APIAddonNotInstalled, APIError, HostNotSupportedError
|
||||||
from ..utils.sentry import async_capture_exception
|
from ..utils.sentry import async_capture_exception
|
||||||
from .addons import APIAddons
|
from .addons import APIAddons
|
||||||
from .audio import APIAudio
|
from .audio import APIAudio
|
||||||
@ -403,6 +403,10 @@ class RestAPI(CoreSysAttributes):
|
|||||||
return await self._api_host.advanced_logs_handler(
|
return await self._api_host.advanced_logs_handler(
|
||||||
*args, identifier="hassio_supervisor", **kwargs
|
*args, identifier="hassio_supervisor", **kwargs
|
||||||
)
|
)
|
||||||
|
except APIError as err:
|
||||||
|
# Advanced logs are generally available, but we did encounter an error
|
||||||
|
# (e.g. connection reset). Those errors should bubble up to the API.
|
||||||
|
raise err
|
||||||
except Exception as err: # pylint: disable=broad-exception-caught
|
except Exception as err: # pylint: disable=broad-exception-caught
|
||||||
# Supervisor logs are critical, so catch everything, log the exception
|
# Supervisor logs are critical, so catch everything, log the exception
|
||||||
# and try to return Docker container logs as the fallback
|
# and try to return Docker container logs as the fallback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user