Skip to content

Commit 3a00a6a

Browse files
committed
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
1 parent 84b265a commit 3a00a6a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

supervisor/api/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from ..const import AddonState
1111
from ..coresys import CoreSys, CoreSysAttributes
12-
from ..exceptions import APIAddonNotInstalled, HostNotSupportedError
12+
from ..exceptions import APIAddonNotInstalled, APIError, HostNotSupportedError
1313
from ..utils.sentry import async_capture_exception
1414
from .addons import APIAddons
1515
from .audio import APIAudio
@@ -403,6 +403,10 @@ async def get_supervisor_logs(*args, **kwargs):
403403
return await self._api_host.advanced_logs_handler(
404404
*args, identifier="hassio_supervisor", **kwargs
405405
)
406+
except APIError as err:
407+
# Advanced logs are generally available, but we did encounter an error
408+
# (e.g. connection reset). Those errors should bubble up to the API.
409+
raise err
406410
except Exception as err: # pylint: disable=broad-exception-caught
407411
# Supervisor logs are critical, so catch everything, log the exception
408412
# and try to return Docker container logs as the fallback

0 commit comments

Comments
 (0)