Log encryption failure tracebacks
When we fail to encrypt a message, we log a message with a complete traceback. The goal is to ensure that when diagnosing it later, we have complete information.
This commit is contained in:
parent
c1c4bd1573
commit
93002c4910
2 changed files with 3 additions and 3 deletions
|
@ -133,8 +133,8 @@ def _gpg_encrypt_to_bytes(message: EmailMessage, keys, recipients, encrypt_f, lm
|
|||
msg_copy = _gpg_encrypt_copy(message, keys, recipients, encrypt_f, lmessage)
|
||||
try:
|
||||
return msg_copy.as_bytes(policy=SMTPUTF8)
|
||||
except IndexError:
|
||||
raise MailSerialisationException()
|
||||
except IndexError as ie:
|
||||
raise MailSerialisationException(ie)
|
||||
|
||||
|
||||
def _gpg_encrypt_to_str(message: EmailMessage, keys, recipients, encrypt_f) -> str:
|
||||
|
|
|
@ -54,7 +54,7 @@ class MailEncryptionProxy:
|
|||
# If the message can't be encrypted or serialised to a
|
||||
# stream of bytes, deliver original payload in
|
||||
# cleartext.
|
||||
LOG.error('Unable to encrypt message, delivering in cleartext: %s', e)
|
||||
LOG.exception('Unable to encrypt message, delivering in cleartext: %s')
|
||||
self._send_unencrypted(operation, envelope, send)
|
||||
|
||||
except xport.TransientFailure:
|
||||
|
|
Loading…
Reference in a new issue