Skip to content

Commit

Permalink
add clarifier to error message (#24449)
Browse files Browse the repository at this point in the history
remove file
  • Loading branch information
andreigurau authored Dec 5, 2022
1 parent 719e594 commit a88956b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdks/python/apache_beam/io/gcp/gcsio.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,4 +823,7 @@ def finish(self):
self._upload_thread.join()
# Check for exception since the last put() call.
if self._upload_thread.last_error is not None:
raise self._upload_thread.last_error # pylint: disable=raising-bad-type
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

2 comments on commit a88956b

@tvalentyn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran a job that couldn't write to a specified bucket, and this job failed with a non-informative error:

  File "/usr/local/lib/python3.9/site-packages/apache_beam/io/gcp/gcsio.py", line 829, in finish
    self._upload_thread.last_error.message)  # pylint: disable=raising-bad-type
AttributeError: 'HttpForbiddenError' object has no attribute 'message' [while running 'Write/Write/WriteImpl/WriteBundles-ptransform-58']

@tvalentyn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed #26769

Please sign in to comment.