Skip to content

Commit

Permalink
fix: ensure that _failure_task exception is always retrieved (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpcollins-google committed Feb 17, 2022
1 parent d22d98c commit 579abf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions google/cloud/pubsublite/internal/wire/permanent_failable.py
Expand Up @@ -93,6 +93,9 @@ async def run_poller(self, poll_action: Callable[[], Awaitable[None]]):
def fail(self, err: GoogleAPICallError):
if not self._failure_task.done():
self._failure_task.set_exception(err)
# Ensure that even if _failure_task is never used, the exception is
# retrieved and the asyncio runtime doesn't print an error.
self._failure_task.exception()

def error(self) -> Optional[GoogleAPICallError]:
if not self._failure_task.done():
Expand Down

0 comments on commit 579abf3

Please sign in to comment.