From 7afd889eda52c91fc8fa6272e8ab477671184fec Mon Sep 17 00:00:00 2001 From: Erik Cederstrand Date: Thu, 4 Apr 2024 11:40:24 +0200 Subject: [PATCH] fix: Catch and return all exceptions that _folders_map() expects to handle as exception objects. Refs #1290 --- exchangelib/services/get_folder.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/exchangelib/services/get_folder.py b/exchangelib/services/get_folder.py index 856a509f..e4496df2 100644 --- a/exchangelib/services/get_folder.py +++ b/exchangelib/services/get_folder.py @@ -1,4 +1,10 @@ -from ..errors import ErrorFolderNotFound, ErrorInvalidOperation, ErrorNoPublicFolderReplicaAvailable +from ..errors import ( + ErrorAccessDenied, + ErrorFolderNotFound, + ErrorInvalidOperation, + ErrorItemNotFound, + ErrorNoPublicFolderReplicaAvailable, +) from ..util import MNS, create_element from .common import EWSAccountService, folder_ids_element, parse_folder_elem, shape_element @@ -9,9 +15,11 @@ class GetFolder(EWSAccountService): SERVICE_NAME = "GetFolder" element_container_name = f"{{{MNS}}}Folders" ERRORS_TO_CATCH_IN_RESPONSE = EWSAccountService.ERRORS_TO_CATCH_IN_RESPONSE + ( + ErrorAccessDenied, ErrorFolderNotFound, ErrorNoPublicFolderReplicaAvailable, ErrorInvalidOperation, + ErrorItemNotFound, ) def __init__(self, *args, **kwargs):