diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-12-13 13:22:37 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-12-13 13:22:37 +0300 |
commit | 006b5e25b21cb1b219288029f6a988b0eda20b87 (patch) | |
tree | 7394a898036004d323f6fd71ce618c94f0a6e853 /cura | |
parent | 5567cc480edb982485dc8b1f183a7f1b1b02c188 (diff) |
Also catch unknown keyring errors
We're confident now that we get it to not crash for most normal cases. If there is a crash here it's due to the internals of Keyring. We're catching all of the others separately anyway.
Fixes Sentry issue CURA-340.
Diffstat (limited to 'cura')
-rw-r--r-- | cura/OAuth2/KeyringAttribute.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cura/OAuth2/KeyringAttribute.py b/cura/OAuth2/KeyringAttribute.py index 35ffdcbd24..58b45a67ef 100644 --- a/cura/OAuth2/KeyringAttribute.py +++ b/cura/OAuth2/KeyringAttribute.py @@ -5,7 +5,7 @@ from typing import Type, TYPE_CHECKING, Optional, List from io import BlockingIOError import keyring from keyring.backend import KeyringBackend -from keyring.errors import NoKeyringError, PasswordSetError, KeyringLocked +from keyring.errors import NoKeyringError, PasswordSetError, KeyringLocked, KeyringError from UM.Logger import Logger @@ -53,6 +53,10 @@ class KeyringAttribute: self._store_secure = False Logger.log("w", "The password retrieved from the keyring cannot be used because it contains characters that cannot be decoded.") return getattr(instance, self._name) + except KeyringError: + self._store_secure = False + Logger.logException("w", "Unknown keyring error.") + return getattr(instance, self._name) else: return getattr(instance, self._name) |