Skip to content

Errors & lifecycle ​

The client throws IOException subclasses for request failures:

TypeMeaningUseful fields
ObjectStorageExceptionThe service returned an HTTP errorstatusCode(), errorCode(), requestId(), retryable()
TransportExceptionConnection or I/O failuregetCause()
ProtocolExceptionA successful response did not match the expected protocolgetMessage()

retryable() means another attempt might help for HTTP 429, 500, 502, 503, or 504. It is not proof that a write was rejected. A write may have completed before a transport failure or a lost response. The client does not automatically retry writes; inspect the object or multipart session before repeating a non-idempotent operation.

Exception messages omit access keys, secret keys, and response bodies. Keep credentials out of your own logs as well.

Close the ObjectStorageClient after use. getObject also returns an ObjectData stream that must be closed separately. Try-with-resources handles both. Do not use a client after close().