Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message for ResumableUpload #802

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

mdedetrich
Copy link
Contributor

@mdedetrich mdedetrich commented Sep 14, 2024

In #799 the erorr message was improved, and i can report that it is actually working with my original expectations, and by that I mean that even the detail part of the error message is being reported (@raboof was right, the printing of the detail part is a configuration setting and its looking like its using sane default values).

As an example, right now the error message is looking like

java.util.concurrent.CompletionException: org.apache.pekko.stream.connectors.google.ResumableUpload$InvalidResponseException: Resumable upload failed with status: 403 Forbidden: body: {"error":{"code":403,"message":"<REDACTED> does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist).","errors":[{"message":"<REDACTED> does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist).","domain":"global","reason":"forbidden"}]}}

The only minor issue currently is that the printing of the error message has parts that are a bit duplicated so this PR fixes that. With this change the error message would look like this

java.util.concurrent.CompletionException: org.apache.pekko.stream.connectors.google.ResumableUpload$InvalidResponseException: Resumable upload failed with status 403 Forbidden: {"error":{"code":403,"message":"<REDACTED> does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist).","errors":[{"message":"<REDACTED> does not have storage.objects.create access to the Google Cloud Storage object. Permission 'storage.objects.create' denied on resource (or it may not exist).","domain":"global","reason":"forbidden"}]}}

Copy link
Contributor

@pjfanning pjfanning left a comment

Choose a reason for hiding this comment

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

lgtm

@pjfanning pjfanning added this to the 1.1.0 milestone Sep 14, 2024
@mdedetrich mdedetrich merged commit 78fd2c6 into apache:main Sep 14, 2024
52 checks passed
@mdedetrich mdedetrich deleted the improve-error-message branch September 14, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants