Skip to content

Commit

Permalink
use RuntimeError with exc chaining instead of overwriting previous ex…
Browse files Browse the repository at this point in the history
…ception
  • Loading branch information
cozos committed Sep 15, 2023
1 parent 5df59a9 commit 4d4089e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sdks/python/apache_beam/io/gcp/gcsio.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,5 +825,4 @@ def finish(self):
# 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" % self._path) from e # pylint: disable=raising-bad-type
raise RuntimeError("Error while uploading file %s" % self._path) from e

0 comments on commit 4d4089e

Please sign in to comment.