Commit 9fa14867 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower Committed by TensorFlower Gardener
Browse files

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
parent cbcf14d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment