mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-01 18:32:05 +00:00
Handle unlock cancellation messages robustly in settings flow
This commit is contained in:
1 parent
882cd060fa
commit
073b1065ca
2 files changed
+19
-6
No files matched your search
+14
-6
@@ -1102,12 +1102,20 @@ def handle_settings(password_manager: PasswordManager) -> None:
|
||||
except PasswordPromptError as exc:
|
||||
print(colored(f"Unlock cancelled: {exc}", "yellow"))
|
||||
except Exception as exc:
|
||||
logging.error(
|
||||
"Failed to unlock vault from settings: %s",
|
||||
exc,
|
||||
exc_info=True,
|
||||
)
|
||||
print(colored(f"Failed to unlock vault: {exc}", "red"))
|
||||
# Some environments can surface cancellation through a
|
||||
# different exception class; treat the message as cancel.
|
||||
if "cancelled by user" in str(exc).lower():
|
||||
logging.warning(
|
||||
"Unlock cancelled during settings lock flow: %s", exc
|
||||
)
|
||||
print(colored(f"Unlock cancelled: {exc}", "yellow"))
|
||||
else:
|
||||
logging.error(
|
||||
"Failed to unlock vault from settings: %s",
|
||||
exc,
|
||||
exc_info=True,
|
||||
)
|
||||
print(colored(f"Failed to unlock vault: {exc}", "red"))
|
||||
else:
|
||||
password_manager.start_background_sync()
|
||||
getattr(
|
||||
|
||||
Reference in new issue
Block a user