From 0585ba97eebbf52db7c8f3162c1483e659c345bf Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Thu, 31 Dec 2020 11:05:11 +0100 Subject: [PATCH] use warning level for "Cannot encrypt using the imported key" error --- app/pgp_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/pgp_utils.py b/app/pgp_utils.py index f82171b4..1b7003eb 100644 --- a/app/pgp_utils.py +++ b/app/pgp_utils.py @@ -43,7 +43,9 @@ def load_public_key_and_check(public_key: str) -> str: try: encrypt_file(dummy_data, fingerprint) except Exception as e: - LOG.exception("Cannot encrypt using the imported key") + LOG.warning( + "Cannot encrypt using the imported key %s %s", fingerprint, public_key + ) # remove the fingerprint gpg.delete_keys([fingerprint]) raise PGPException("Encryption fails with the key") from e