pub enum Reason {
Show 65 variants MediaDownloadRedirect, NotModified, TemporaryRedirect, Invalid, BadRequest, BadRequestException, CloudKmsBadKey, CloudKmsCannotChangeKeyName, CloudKmsDecryptionKeyNotFound, CloudKmsDisabledKey, CloudKmsEncryptionKeyNotFound, CloudKmsKeyLocationNotAllowed, CustomerEncryptionAlgorithmIsInvalid, CustomerEncryptionKeyFormatIsInvalid, CustomerEncryptionKeyIsIncorrect, CustomerEncryptionKeySha256IsInvalid, InvalidAltValue, InvalidArgument, InvalidParameter, NotDownload, NotUpload, ParseError, PushChannelIdInvalid, PushChannelIdNotUnique, PushWebhookUrlNoHostOrAddress, PushWebhookUrlNotHttps, Required, ResourceIsEncryptedWithCustomerEncryptionKey, ResourceNotEncryptedWithCustomerEncryptionKey, TurnedDown, UserProjectInconsistent, UserProjectInvalid, UserProjectMissing, WrongUrlForUpload, AuthenticationRequiredRequesterPays, AuthError, LockedDomainExpired, PushWebhookUrlUnauthorized, AccountDisabled, CountryBlocked, Forbidden, InsufficientPermissions, ObjectUnderActiveHold, RateLimitExceeded, RetentionPolicyNotMet, SslRequired, StopChannelCallerNotOwner, UsageLimitsAccessNotConfigured, UserProjectAccessDenied, UserProjectAccountProblem, UserRateLimitExceeded, QuotaExceeded, NotFound, MethodNotAllowed, UploadBrokenConnection, Conflict, Gone, ConditionNotMet, OrgPolicyConstraintFailed, UploadTooLarge, RequestedRangeNotSatisfiable, UsageLimitsRateLimitExceeded, BackendError, InternalError, GatewayTimeout,
}
Expand description

Google provides a list of codes, but testing indicates that this list is not exhaustive.

Variants

MediaDownloadRedirect

When requesting a download using alt=media URL parameter, the direct URL path to use is prefixed by /download. If this is omitted, the service will issue this redirect with the appropriate media download path in the Location header.

NotModified

The conditional request would have been successful, but the condition was false, so no body was sent.

TemporaryRedirect

Resource temporarily located elsewhere according to the Location header. Among other reasons, this can occur when cookie-based authentication is being used, e.g., when using the Storage Browser, and it receives a request to download content.

Invalid

Undocumeten variant that is sometimes returned by Google.

BadRequest

The request cannot be completed based on your current Cloud Storage settings. For example, you cannot lock a retention policy if the requested bucket doesn’t have a retention policy, and you cannot set ACLs if the requested bucket has Bucket Policy Only enabled.

BadRequestException

The retention period on a locked bucket cannot be reduced.

CloudKmsBadKey

Bad Cloud KMS key.

CloudKmsCannotChangeKeyName

Cloud KMS key name cannot be changed.

CloudKmsDecryptionKeyNotFound

Resource’s Cloud KMS decryption key not found.

CloudKmsDisabledKey

Cloud KMS key is disabled, destroyed, or scheduled to be destroyed.

CloudKmsEncryptionKeyNotFound

Cloud KMS encryption key not found.

CloudKmsKeyLocationNotAllowed

Cloud KMS key location not allowed.

CustomerEncryptionAlgorithmIsInvalid

Missing an encryption algorithm, or the provided algorithm is not “AE256.”

CustomerEncryptionKeyFormatIsInvalid

Missing an encryption key, or it is not Base64 encoded, or it does not meet the required length of the encryption algorithm.

CustomerEncryptionKeyIsIncorrect

The provided encryption key is incorrect.

CustomerEncryptionKeySha256IsInvalid

Missing a SHA256 hash of the encryption key, or it is not Base64 encoded, or it does not match the encryption key.

InvalidAltValue

The value for the alt URL parameter was not recognized.

InvalidArgument

The value for one of fields in the request body was invalid.

InvalidParameter

The value for one of the URL parameters was invalid. In addition to normal URL parameter validation, any URL parameters that have a corresponding value in provided JSON request bodies must match if they are both specified. If using JSONP, you will get this error if you provide an alt parameter that is not json.

NotDownload

Uploads or normal API request was sent to a /download/* path. Use the same path, but without the /download prefix.

NotUpload

Downloads or normal API request was sent to an /upload/* path. Use the same path, but without the /upload prefix.

ParseError

Could not parse the body of the request according to the provided Content-Type.

PushChannelIdInvalid

Channel id must match the following regular expression: [A-Za-z0-9\\-_\\+/=]+.

PushChannelIdNotUnique

storage.objects.watchAll’s id property must be unique across channels.

PushWebhookUrlNoHostOrAddress

storage.objects.watchAll’s address property must contain a valid URL.

PushWebhookUrlNotHttps

storage.objects.watchAll’s address property must be an HTTPS URL.

Required

A required URL parameter or required request body JSON property is missing.

ResourceIsEncryptedWithCustomerEncryptionKey

The resource is encrypted with a customer-supplied encryption key, but the request did not provide one.

ResourceNotEncryptedWithCustomerEncryptionKey

The resource is not encrypted with a customer-supplied encryption key, but the request provided one.

TurnedDown

A request was made to an API version that has been turned down. Clients will need to update to a supported version.

UserProjectInconsistent

The user project specified in the request does not match the user project specifed in an earlier, related request.

UserProjectInvalid

The user project specified in the request is invalid, either because it is a malformed project id or because it refers to a non-existent project.

UserProjectMissing

The requested bucket has Requester Pays enabled, the requester is not an owner of the bucket, and no user project was present in the request.

WrongUrlForUpload

storage.objects.insert must be invoked as an upload rather than a metadata.

AuthenticationRequiredRequesterPays

Access to a Requester Pays bucket requires authentication.

AuthError

This error indicates a problem with the authorization provided in the request to Cloud Storage. The following are some situations where that will occur:

  • The OAuth access token has expired and needs to be refreshed. This can be avoided by refreshing the access token early, but code can also catch this error, refresh the token and retry automatically.
  • Multiple non-matching authorizations were provided; choose one mode only.
  • The OAuth access token’s bound project does not match the project associated with the provided developer key.
  • The Authorization header was of an unrecognized format or uses an unsupported credential type.

LockedDomainExpired

When downloading content from a cookie-authenticated site, e.g., using the Storage Browser, the response will redirect to a temporary domain. This error will occur if access to said domain occurs after the domain expires. Issue the original request again, and receive a new redirect.

PushWebhookUrlUnauthorized

Requests to storage.objects.watchAll will fail unless you verify you own the domain.

AccountDisabled

The account associated with the project that owns the bucket or object has been disabled. Check the Google Cloud Console to see if there is a problem with billing, and if not, contact account support.

CountryBlocked

The Cloud Storage JSON API is restricted by law from operating with certain countries.

Forbidden

According to access control policy, the current user does not have access to perform the requested action. This code applies even if the resource being acted on doesn’t exist.

InsufficientPermissions

According to access control policy, the current user does not have access to perform the requested action. This code applies even if the resource being acted on doesn’t exist.

ObjectUnderActiveHold

Object overwrite or deletion is not allowed due to an active hold on the object.

RateLimitExceeded

The Cloud Storage rate limit was exceeded. Retry using exponential backoff.

RetentionPolicyNotMet

Object overwrite or deletion is not allowed until the object meets the retention period set by the retention policy on the bucket.

SslRequired

Requests to this API require SSL.

StopChannelCallerNotOwner

Calls to storage.channels.stop require that the caller own the channel.

UsageLimitsAccessNotConfigured

This error implies that for the project associated with the OAuth token or the developer key provided, access to Cloud Storage JSON API is not enabled. This is most commonly because Cloud Storage JSON API is not enabled in the Google Cloud Console, though there are other cases where the project is blocked or has been deleted when this can occur.

UserProjectAccessDenied

The requester is not authorized to use the project specified in their request. The requester must have either the serviceusage.services.use permission or the Editor role for the specified project.

UserProjectAccountProblem

There is a problem with the project used in the request that prevents the operation from completing successfully. One issue could be billing. Check the billing page to see if you have a past due balance or if the credit card (or other payment mechanism) on your account is expired. For project creation, see the Projects page in the Google Cloud Console. For other problems, see the Resources and Support page.

UserRateLimitExceeded

The developer-specified per-user rate quota was exceeded. If you are the developer, then you can view these quotas at Quotas pane in the Google Cloud Console.

QuotaExceeded

Seems to indicate the same thing

NotFound

Either there is no API method associated with the URL path of the request, or the request refers to one or more resources that were not found.

MethodNotAllowed

Either there is no API method associated with the URL path of the request, or the request refers to one or more resources that were not found.

UploadBrokenConnection

The request timed out. Please try again using truncated exponential backoff.

Conflict

A request to change a resource, usually a storage..update or storage..patch method, failed to commit the change due to a conflicting concurrent change to the same resource. The request can be retried, though care should be taken to consider the new state of the resource to avoid blind overwriting of other agent’s changes.

Gone

You have attempted to use a resumable upload session that is no longer available. If the reported status code was not successful and you still wish to upload the file, you must start a new session.

ConditionNotMet

At least one of the pre-conditions you specified did not hold.

OrgPolicyConstraintFailed

Request violates an OrgPolicy constraint.

UploadTooLarge

The Cloud Storage JSON API supports up to 5 TB objects.

This error may, alternatively, arise if copying objects between locations and/or storage classes can not complete within 30 seconds. In this case, use the Object::rewrite method instead.

RequestedRangeNotSatisfiable

The requested Range cannot be satisfied.

UsageLimitsRateLimitExceeded

A Cloud Storage JSON API usage limit was exceeded. If your application tries to use more than its limit, additional requests will fail. Throttle your client’s requests, and/or use truncated exponential backoff.

BackendError

We encountered an internal error. Please try again using truncated exponential backoff.

InternalError

We encountered an internal error. Please try again using truncated exponential backoff.

GatewayTimeout

May be returned by Google, meaning undocumented.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more