diff --git a/exchangelib/services.py b/exchangelib/services.py index f17c0a2..389c13e 100644 --- a/exchangelib/services.py +++ b/exchangelib/services.py @@ -30,11 +30,13 @@ ErrorInternalServerTransientError, ErrorNoRespondingCASInDestinationSite, ErrorImpersonationFailed, \ ErrorMailboxMoveInProgress, ErrorAccessDenied, ErrorConnectionFailed, RateLimitError, ErrorServerBusy, \ ErrorTooManyObjectsOpened, ErrorInvalidLicense, ErrorInvalidSchemaVersionForMailboxVersion, \ - ErrorInvalidServerVersion, ErrorInvalidSyncStateData, ErrorItemNotFound, ErrorADUnavailable, ResponseMessageError, ErrorInvalidChangeKey, \ + ErrorInvalidServerVersion, ErrorInvalidSyncStateData, ErrorItemNotFound, ErrorADUnavailable, ResponseMessageError, \ + ErrorInvalidChangeKey, \ ErrorItemSave, ErrorInvalidIdMalformed, ErrorMessageSizeExceeded, UnauthorizedError, \ ErrorCannotDeleteTaskOccurrence, ErrorMimeContentConversionFailed, ErrorRecurrenceHasNoOccurrence, \ ErrorNameResolutionMultipleResults, ErrorNameResolutionNoResults, ErrorNoPublicFolderReplicaAvailable, \ - ErrorInvalidOperation, ErrorSubscriptionUnsubscribed, MalformedResponseError + ErrorInvalidOperation, ErrorSubscriptionUnsubscribed, MalformedResponseError, \ + ErrorInvalidIdMalformedEwsLegacyIdFormat from .ewsdatetime import EWSDateTime, NaiveDateTimeNotAllowed from .transport import wrap, extra_headers from .util import chunkify, create_element, add_xml_child, get_xml_attr, to_xml, post_ratelimited, \ @@ -496,12 +498,16 @@ def _get_exception(cls, code, text, msg_xml): def _get_elements_in_response(self, response): for msg in response: - container_or_exc = self._get_element_container(message=msg, name=self.element_container_name) - if isinstance(container_or_exc, (bool, Exception)): - yield container_or_exc - else: - for c in self._get_elements_in_container(container=container_or_exc): - yield c + try: + container_or_exc = self._get_element_container(message=msg, name=self.element_container_name) + if isinstance(container_or_exc, (bool, Exception)): + yield container_or_exc + else: + for c in self._get_elements_in_container(container=container_or_exc): + yield c + except ErrorInvalidIdMalformedEwsLegacyIdFormat as e: + log.error('Caught ErrorInvalidIdMalformedEwsLegacyIdFormat error', e=e, exc_info=True, msg=msg) + continue @staticmethod def _get_elements_in_container(container):