SquareCloudBlobError
Every API failure throws a SquareCloudBlobError.
What is not a SquareCloudBlobError
- Network errors are not wrapped. When a request gets no complete response (DNS failure, connection reset, a body cut off mid-read), the original
fetcherror is thrown as-is, after any retries. - File errors. In Node.js, a
put()path that cannot be opened throws a plainError(Cannot open the file "<path>". Check that the path exists and that this process can read it., original error incause). Outside Node.js, any path throws a plainError(File paths can only be uploaded in Node.js. Pass a Blob, a File or bytes instead.). - A missing
@aws-sdk/client-s3.s3()throws a plainErrorthat says how to install it, or to passs3Credentials()to another S3 client, with the import error incause.
UNKNOWN_ERROR
UNKNOWN_ERROR is the only code that does not come from the service. It is used when the response has no error code: a non-JSON body (a proxy error page, for example) or a 2xx response without status: "success". status still holds the real HTTP status, and message names that status and the likely cause (before 4.2.0, it was the code itself).
Per-object failures
Batch operations report failures in their result instead of throwing:update(): each result hasok: falseand acode.delete([ids]): missing objects go tonot_found, other failures tofailed.
Error codes
BlobErrorCode is the Blob Storage API’s own list of codes. It is not the same list as the main Square Cloud API’s error codes. For each code’s HTTP status and meaning, see the Blob API errors reference.
Global
Global
ACCESS_DENIED, RATE_LIMITED, MISSING_SCOPE, RESOURCE_NOT_ALLOWED, UPLOAD_TOKEN_NOT_ALLOWED, UPLOAD_TOKEN_USED, PREFIX_NOT_ALLOWED, PERMISSION_DENIED, ACCOUNT_BLOCKED, UPGRADE_REQUIRED, STORAGE_QUOTA_EXCEEDED, PRIVATE_STORAGE_UNAVAILABLE, PUBLIC_STORAGE_UNAVAILABLE, TOO_MANY_CONCURRENT_UPLOADS, UPLOAD_FAILED, STORAGE_UNAVAILABLE, INTERNAL_SERVER_ERROR, NOT_FOUNDSTORAGE_UNAVAILABLE (503) means storage is briefly unreachable. See Storage outages.RATE_LIMIT is deprecated: the service no longer sends it (see RATE_LIMITED), but it stays in the type.Objects
Objects
OBJECT_NOT_FOUND, OBJECT_ALREADY_EXISTS, CHECKSUM_MISMATCH, INVALID_CONTENT_TYPE, FILE_TOO_LARGE, FILE_TOO_SMALL, BLOCKED_FILE_TYPE, INVALID_FILE_TYPE, FILE_TYPE_NOT_ALLOWED, NOTHING_TO_UPDATE, VISIBILITY_CHANGE_FAILED, UPDATE_FAILED, DELETE_FAILED, TOO_MANY_OBJECTS, SAME_OBJECT, INVALID_DESTINATION, COPY_FAILED, PREFIX_REQUIRED, INVALID_CONTINUATION_TOKENOBJECT_IS_LEGACY is deprecated: the service no longer sends it, but it stays in the type.Multipart (chunked) uploads
Multipart (chunked) uploads
TOO_MANY_CONCURRENT_CHUNKS, TOO_MANY_OPEN_UPLOADS, INVALID_UPLOAD_TOKEN, UPLOAD_NOT_FOUND, NO_CHUNKS_UPLOADED, EMPTY_CHUNK, INVALID_CHUNK_PART, CHUNK_TOO_SMALL, CHUNK_TOO_LARGEValidation (400)
Validation (400)
Any
INVALID_* code, such as INVALID_OBJECT, INVALID_OBJECT_NAME or INVALID_RULE_PREFIX. Rule errors carry the offending prefix in error.extra.SDK
SDK
UNKNOWN_ERROR: the response had no error code (see above).BlobErrorCode also accepts any other string, so a code the service adds later still type-checks.
Retry policy
The SDK only retries what is safe to repeat:GET calls and multipart upload parts (each part number can be sent again).
A retryable call is retried on:
- a network error (including a body cut off mid-read);
- any
5xxresponse; TOO_MANY_CONCURRENT_CHUNKSon a multipart part: the server refuses the part before reading it, so it is sent again within the same budget.
4xx, including 429. RATE_LIMITED can be an account block that lasts about 30 minutes, so the SDK leaves the decision to you.
Backoff
Before retryn (starting at 0), the SDK waits:
maxRetries: 2, a call makes at most 3 attempts.
Storage outages
503 STORAGE_UNAVAILABLE means storage is briefly unreachable: the service refuses object calls in windows of about 10 seconds.
- Reads and multipart parts retry it within
maxRetries, which may not outlast the window: the default 2 retries take under 2 seconds. - Every other call gets a single attempt.
- When it still fails, try again after about 10 seconds.
- A multipart upload refused this way when it completes is aborted, like any other failure: run the whole
put()again.
Retrying writes yourself
A write that fails with a network error or a5xx may or may not have been applied. Retry it only when repeating it is safe for you, for example a put() to the same name with overwrite: true.
Timeouts
There is no client timeout and no way to cancel a call: a request lasts as long asfetch waits.
Next steps
Blob API errors reference
Every Blob error code, with its HTTP status.
Client
Credentials and client options.

