mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Log cloud backup upload response status (#134871)
Log the status of the upload response
This commit is contained in:
parent
2c7a1446b8
commit
c4455c709b
@ -157,6 +157,11 @@ class CloudBackupAgent(BackupAgent):
|
|||||||
headers=details["headers"] | {"content-length": str(backup.size)},
|
headers=details["headers"] | {"content-length": str(backup.size)},
|
||||||
timeout=ClientTimeout(connect=10.0, total=43200.0), # 43200s == 12h
|
timeout=ClientTimeout(connect=10.0, total=43200.0), # 43200s == 12h
|
||||||
)
|
)
|
||||||
|
_LOGGER.log(
|
||||||
|
logging.DEBUG if upload_status.status < 400 else logging.WARNING,
|
||||||
|
"Backup upload status: %s",
|
||||||
|
upload_status.status,
|
||||||
|
)
|
||||||
upload_status.raise_for_status()
|
upload_status.raise_for_status()
|
||||||
except (TimeoutError, ClientError) as err:
|
except (TimeoutError, ClientError) as err:
|
||||||
raise BackupAgentError("Failed to upload backup") from err
|
raise BackupAgentError("Failed to upload backup") from err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user