From b02fa2b5354bb861ab46cc5cd85c360edf5e228d Mon Sep 17 00:00:00 2001 From: Dan Hendry Date: Wed, 21 Feb 2024 15:54:28 -0500 Subject: [PATCH] fix: Add exception handlers for Cancelled and StopIteration in bidi.BackgroundConsumer to eliminate error logs --- google/api_core/bidi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google/api_core/bidi.py b/google/api_core/bidi.py index 78d98b98b..10b979dc3 100644 --- a/google/api_core/bidi.py +++ b/google/api_core/bidi.py @@ -663,7 +663,8 @@ def _thread_main(self, ready): response = self._bidi_rpc.recv() _LOGGER.debug("recved response.") self._on_response(response) - + except (exceptions.Cancelled, StopIteration): + pass except exceptions.GoogleAPICallError as exc: _LOGGER.debug( "%s caught error %s and will exit. Generally this is due to "