def _handle_exception(self, exception: Exception):
    if self._raise_exceptions:
        raise exception
    else:
        self.exceptions.append(exception)
def _handle_exception(self, exception: Exception):
    if self._raise_exceptions:
        raise exception
    else:
        self.exceptions.append(exception)