def METHOD_NAME(self, task):
    self._unfinished_tasks -= 1
    assert self._unfinished_tasks >= 0
    if self._on_completed_fut is not None and not self._unfinished_tasks:
        if not self._on_completed_fut.done():
            self._on_completed_fut.set_result(True)
    if task.cancelled():
        return
    exc = task.exception()
    if exc is None:
        return
    self._errors.append(exc)
    if self._is_base_error(exc) and self._base_error is None:
        self._base_error = exc
    self._cancel()