mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 01:26:35 +00:00
Handle ClientPayloadError in advanced logging (#5869)
When the systemd-journal-gatewayd service is being shutdown while Supervisor is still trying to read logs, aiohttp throws a ClientPayloadError, presumably because we try to read until the next linefeed, which aiohttp cannot satisfy anymore. Simply catch the exception just like the connection reset errors previously in #5358 and #5715.
This commit is contained in:
parent
85f8107b60
commit
36da382af3
@ -5,7 +5,7 @@ from contextlib import suppress
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from aiohttp import ClientConnectionResetError, web
|
||||
from aiohttp import ClientConnectionResetError, ClientPayloadError, web
|
||||
from aiohttp.hdrs import ACCEPT, RANGE
|
||||
import voluptuous as vol
|
||||
from voluptuous.error import CoerceInvalid
|
||||
@ -269,7 +269,8 @@ class APIHost(CoreSysAttributes):
|
||||
err,
|
||||
)
|
||||
break
|
||||
except ConnectionResetError as ex:
|
||||
except (ConnectionResetError, ClientPayloadError) as ex:
|
||||
# ClientPayloadError is most likely caused by the closing the connection
|
||||
raise APIError(
|
||||
"Connection reset when trying to fetch data from systemd-journald."
|
||||
) from ex
|
||||
|
Loading…
x
Reference in New Issue
Block a user