Make 403 errors due to GCS more verbose.
The current GCS client code neglects to print the nature of a 403 error. For
example, a 403 error can occur because of permissions or rate limiting. The
nature of a 403 error is communicated through the HTTP response. Thus, this
patch extends the 403 error message with the HTTP response returned by curl.
As an example, a 403 error looked like this before this patch:
PermissionDeniedError: Error executing an HTTP request (HTTP response code 403, error code 0, error message '')
With this patch, it might look like:
PermissionDeniedError: Error executing an HTTP request (HTTP response code 403, error code 0, error message ''), response {
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "userRateLimitExceeded",
"message": "User Rate Limit Exceeded"
}
],
"code": 403,
"message": "User Rate Limit Exceeded"
}
}
PiperOrigin-RevId: 180853399
Loading
Please sign in to comment