Skip to content

Commit

Permalink
fix: Catch and return all exceptions that _folders_map() expects to h…
Browse files Browse the repository at this point in the history
…andle as exception objects. Refs #1290
  • Loading branch information
Erik Cederstrand committed Apr 4, 2024
1 parent d2fbf1d commit 7afd889
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion exchangelib/services/get_folder.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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):
Expand Down

0 comments on commit 7afd889

Please sign in to comment.