-
Notifications
You must be signed in to change notification settings - Fork 86
Wrap error thrown in Storage Client #1492
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
Wrap error thrown in Storage Client #1492
Conversation
7cf93bd to
60162f4
Compare
itsankit-google
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add screenshots of testing in CDAP sandbox.
itsankit-google
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some more methods in this class where storage client is used, we need to do the same thing there.
For example:
| storage.update(BlobInfo.newBuilder(blob.getBlobId()).setMetadata(metaData).build()); |
| throw new RuntimeException( | ||
| String.format("Unable to access source bucket %s. ", sourcePath.getBucket()) | ||
| + "Ensure you entered the correct bucket path.", e); | ||
| String errorReason = String.format("Unable to access GCS bucket '%s'", destPath.getBucket()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sourcePath.getBucket()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated !
Updated ! |
e65fed2 to
2d00e1b
Compare
|
Did not wrap |
|
Please squash commits before merge. |
It is okay, we can still wrap if that method gets used anywhere later. |
bb755ad to
941af45
Compare
941af45 to
083b430
Compare
Ref : #1485 (comment) , #1488 (review)
Test
Raw Logs
POST v3/namespaces/{namespace-id}/apps/{app-id}/workflows/DataPipelineWorkflow/runs/{run-id}/classify
[ { "stageName": "GCS Copy", "errorCategory": "Plugin-'GCS Copy'", "errorReason": "403 Forbidden. Please check you have permission to access this resource. For more details, see https://cloud.google.com/storage/docs/json_api/v1/status-codes", "errorMessage": "com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden\nPOST https://storage.googleapis.com/storage/v1/b?project=cdf-entcon&projection=full\n{\n \"code\" : 403,\n \"errors\" : [ {\n \"domain\" : \"global\",\n \"message\" : \"[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).\",\n \"reason\" : \"forbidden\"\n } ],\n \"message\" : \"[email protected] does not have storage.buckets.create access to the Google Cloud project. Permission 'storage.buckets.create' denied on resource (or it may not exist).\"\n}", "errorType": "USER", "dependency": "true", "errorCodeType": "HTTP", "errorCode": "403", "supportedDocumentationUrl": "https://cloud.google.com/storage/docs/json_api/v1/status-codes" } ]