catch all exception in load_public_key()
This commit is contained in:
parent
4f211bba61
commit
bb8c9451c4
|
@ -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 New Issue