From 8a6517d7572a63038aff53d076bce2000d8ba8bf Mon Sep 17 00:00:00 2001 From: pengfeiye Date: Fri, 15 Dec 2023 17:27:43 -0500 Subject: [PATCH] Fixing error logging that is raising key error --- exchangelib/services.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/exchangelib/services.py b/exchangelib/services.py index 2835029..838f9e3 100644 --- a/exchangelib/services.py +++ b/exchangelib/services.py @@ -507,7 +507,15 @@ def _get_elements_in_response(self, response): yield c except ErrorInvalidIdMalformedEwsLegacyIdFormat as e: msg_text = get_xml_attr(msg, '{%s}MessageText' % MNS) - log.error('Caught ErrorInvalidIdMalformedEwsLegacyIdFormat error', error=str(e), exc_info=True, response_msg=msg_text) + log.error( + 'Caught ErrorInvalidIdMalformedEwsLegacyIdFormat' + '\nerror: %s' + '\nmsg_response: %s', + str(e), + msg_text, + exc_info=True + ) + continue @staticmethod