From 702da2692c7892780e9549b6463a7a51476a8874 Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Mon, 5 May 2025 18:02:00 -0700 Subject: [PATCH 1/2] fix(plugin): error handling for list_members --- src/dispatch/plugins/dispatch_google/groups/plugin.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dispatch/plugins/dispatch_google/groups/plugin.py b/src/dispatch/plugins/dispatch_google/groups/plugin.py index 74c502885e68..56db0bb255c6 100644 --- a/src/dispatch/plugins/dispatch_google/groups/plugin.py +++ b/src/dispatch/plugins/dispatch_google/groups/plugin.py @@ -104,7 +104,15 @@ def remove_member(client: Any, group_key: str, email: str): def list_members(client: Any, group_key: str, **kwargs): """Lists all members of google group.""" - return make_call(client.members(), "list", groupKey=group_key, **kwargs) + + try: + return make_call(client.members(), "list", groupKey=group_key, **kwargs) + except HttpError as e: + if e.resp.status in [404]: + log.debug(f"Group does not exist. GroupKey={group_key} Trying to list members.") + return + else: + raise e def create_group(client: Any, name: str, email: str, description: str): From 945532932176192e3f90ec380208733d23d8728b Mon Sep 17 00:00:00 2001 From: David Whittaker Date: Mon, 5 May 2025 18:02:38 -0700 Subject: [PATCH 2/2] remove whitespace --- src/dispatch/plugins/dispatch_google/groups/plugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dispatch/plugins/dispatch_google/groups/plugin.py b/src/dispatch/plugins/dispatch_google/groups/plugin.py index 56db0bb255c6..1b0faecad4d2 100644 --- a/src/dispatch/plugins/dispatch_google/groups/plugin.py +++ b/src/dispatch/plugins/dispatch_google/groups/plugin.py @@ -104,7 +104,6 @@ def remove_member(client: Any, group_key: str, email: str): def list_members(client: Any, group_key: str, **kwargs): """Lists all members of google group.""" - try: return make_call(client.members(), "list", groupKey=group_key, **kwargs) except HttpError as e: