Google App Engine
Feedback on this document

Errors and Error Handling

The GCS client library functions access Google Cloud Storage through the App Engine UrlFetch feature. As a result, there are three sources of possible errors:

  • App Engine UrlFetch transient errors errors.
  • GCS transient errors.
  • GCS errors related to buckets and object authorization.

The GCS client library handles timeout errors on both the App Engine side and the GCS side and performs retries automatically, so your app does not need to add logic to handle this. The configuration of the timeout and retry mechanism is exposed through the RetryParams class, which you can use to change any or all of the default settings. You can make your changes to apply to all function calls or you can specify changes for a specific call using the function's retry_params parameter.

Errors

The cloudstore.errors module has the following exception classes:

exception Error()

The base class for all exceptions in this package. Errors can be generated from App Engine or from Google Cloud Storage. For details on HTTP error codes from GCS, see HTTP Status and Error Codes in the GCS documentation.

exception AuthorizationError
An unauthorized request was received by GCS. This error can occur if an authorized app is using an access token that has expired. Normally, this error is handled automatically in the GCS client library, which gets a new access token and retries the request.
exception ForbiddenError()

This error (403) indicates that the user was not authorized by GCS to make the request. The various possible causes for this error are listed in the GCS error documentation for 403-Forbidden. However, a common source of this error is that the bucket permissions (bucket ACL) are not set properly to allow your app access. (See Activation for information on setting up bucket access.)

exception NotFoundError()
HTTP error 404. The bucket or object you specified in a call to cloudstorage.delete(), cloudstorage.listbucket(), cloudstorage.open(), or cloudstorage.stat() does not exist.
exception TimeoutError()
This error is raised when the attempt to contact GCS servers times out even after retry attempts. (See RetryParams for information on changing the default timeout handling and retries.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.