diff --git a/sdks/python/apache_beam/io/gcp/gcsio.py b/sdks/python/apache_beam/io/gcp/gcsio.py index 541bbfd94113..2fdbce73170a 100644 --- a/sdks/python/apache_beam/io/gcp/gcsio.py +++ b/sdks/python/apache_beam/io/gcp/gcsio.py @@ -824,7 +824,6 @@ def finish(self): self._upload_thread.join() # Check for exception since the last put() call. if self._upload_thread.last_error is not None: + e = self._upload_thread.last_error raise type(self._upload_thread.last_error)( - "Error while uploading file %s: %s", - self._path, - self._upload_thread.last_error.message) # pylint: disable=raising-bad-type + "Error while uploading file %s" % self._path) from e # pylint: disable=raising-bad-type