Log exception and traceback when we fail-over to cleartext

This commit is contained in:
Piotr F. Mieszkowski 2024-03-03 09:26:50 +01:00
parent 0ec1bc3056
commit e28864074c
Signed by: pfm
GPG key ID: BDE5BC1FA5DC53D5

View file

@ -48,9 +48,9 @@ class MailEncryptionProxy:
try:
new_message = operation.perform(message)
send(new_message, operation.recipients())
except (EncryptionException, MailSerialisationException, UnicodeEncodeError) as e:
except (EncryptionException, MailSerialisationException, UnicodeEncodeError):
# If the message can't be encrypted, deliver cleartext.
LOG.error('Unable to encrypt message, delivering in cleartext: %s', e)
LOG.exception('Unable to encrypt message, delivering in cleartext')
if not isinstance(operation, KeepIntact):
self._send_unencrypted(operation, envelope, send)
else: