mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
catch all exception in load_public_key()
This commit is contained in:
parent
4f211bba61
commit
bb8c9451c4
1 changed files with 1 additions and 1 deletions
|
@ -21,8 +21,8 @@ class PGPException(Exception):
|
|||
|
||||
def load_public_key(public_key: str) -> str:
|
||||
"""Load a public key into keyring and return the fingerprint. If error, raise Exception"""
|
||||
import_result = gpg.import_keys(public_key)
|
||||
try:
|
||||
import_result = gpg.import_keys(public_key)
|
||||
return import_result.fingerprints[0]
|
||||
except Exception as e:
|
||||
raise PGPException("Cannot load key") from e
|
||||
|
|
Loading…
Reference in a new issue