mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Improve logging of backup upload errors (#135672)
Improve logging for upload errors
This commit is contained in:
parent
31c36beb2e
commit
4ccc686295
@ -430,18 +430,21 @@ class BackupManager:
|
|||||||
return_exceptions=True,
|
return_exceptions=True,
|
||||||
)
|
)
|
||||||
for idx, result in enumerate(sync_backup_results):
|
for idx, result in enumerate(sync_backup_results):
|
||||||
|
agent_id = agent_ids[idx]
|
||||||
if isinstance(result, BackupReaderWriterError):
|
if isinstance(result, BackupReaderWriterError):
|
||||||
# writer errors will affect all agents
|
# writer errors will affect all agents
|
||||||
# no point in continuing
|
# no point in continuing
|
||||||
raise BackupManagerError(str(result)) from result
|
raise BackupManagerError(str(result)) from result
|
||||||
if isinstance(result, BackupAgentError):
|
if isinstance(result, BackupAgentError):
|
||||||
LOGGER.error("Error uploading to %s: %s", agent_ids[idx], result)
|
agent_errors[agent_id] = result
|
||||||
agent_errors[agent_ids[idx]] = result
|
LOGGER.error("Upload failed for %s: %s", agent_id, result)
|
||||||
continue
|
continue
|
||||||
if isinstance(result, Exception):
|
if isinstance(result, Exception):
|
||||||
# trap bugs from agents
|
# trap bugs from agents
|
||||||
agent_errors[agent_ids[idx]] = result
|
agent_errors[agent_id] = result
|
||||||
LOGGER.error("Unexpected error: %s", result, exc_info=result)
|
LOGGER.error(
|
||||||
|
"Unexpected error for %s: %s", agent_id, result, exc_info=result
|
||||||
|
)
|
||||||
continue
|
continue
|
||||||
if isinstance(result, BaseException):
|
if isinstance(result, BaseException):
|
||||||
raise result
|
raise result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user