Catch and log unexpected backup ciphering errors (#144531)

This commit is contained in:
Erik Montnemery 2025-05-09 09:55:32 +02:00 committed by GitHub
parent 7287f302f6
commit 2c8e33558e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -332,6 +332,9 @@ def decrypt_backup(
except (DecryptError, SecureTarError, tarfile.TarError) as err:
LOGGER.warning("Error decrypting backup: %s", err)
error = err
except Exception as err: # noqa: BLE001
LOGGER.exception("Unexpected error when decrypting backup: %s", err)
error = err
else:
# Pad the output stream to the requested minimum size
padding = max(minimum_size - output_stream.tell(), 0)
@ -417,6 +420,9 @@ def encrypt_backup(
except (EncryptError, SecureTarError, tarfile.TarError) as err:
LOGGER.warning("Error encrypting backup: %s", err)
error = err
except Exception as err: # noqa: BLE001
LOGGER.exception("Unexpected error when decrypting backup: %s", err)
error = err
else:
# Pad the output stream to the requested minimum size
padding = max(minimum_size - output_stream.tell(), 0)