Show the report an interrupted restore carries

This commit is contained in:
J. Nick Koston
2026-10-13 07:28:38 -10:00
committed by GitHub
parent e0b7a84957
commit fc07080633
+3 -3
View File
@@ -249,9 +249,9 @@ def _restore(originals: dict[Path, Snapshot], keys: str) -> None:
try:
restore_files(originals)
except (EsphomeError, KeyboardInterrupt) as err:
safe_print(
color(AnsiFore.BOLD_RED, str(err) or f"Interrupted restoring {files}")
)
# An interrupted restore carries its report as a note
why = str(err) or "; ".join(getattr(err, "__notes__", ()))
safe_print(color(AnsiFore.BOLD_RED, why or f"Interrupted restoring {files}"))
safe_print(keys)
else:
safe_print(color(AnsiFore.BOLD_YELLOW, f"Restored the previous key in {files}"))