edit-icon download-icon

Exception handling

Last Updated: Oct 25, 2017

OSS Android SDK may be subject to two types of exceptions: ClientException and ServiceException, which are as follows:

ClientException

ClientException indicates an exception inside SDK, such as an incorrect parameter, an unreachable network, or an active cancellation.

ServiceException

OSSException indicates a server error, which is from parsing a server error message. OSSException generally has the following components:

  • Code: The error code OSS returns to users.

  • Message: The detailed error message provided by OSS.

  • RequestId: The UUID that uniquely identifies the request. When you cannot solve the problem, you can seek help from OSS development engineers by providing this RequestId.

  • HostId: Marking the accessed OSS cluster.

  • rawMessage The original body text of an HTTP response.

The following are common OSS exceptions:

Error Code Description
AccessDenied Access denied
BucketAlreadyExists The bucket already exists.
BucketNotEmpty The bucket is not empty.
EntityTooLarge The entity is too large.
EntityTooSmall The entity is too small.
FileGroupTooLarge The object group is too large.
FilePartNotExist An object part does not exist.
FilePartStale An object part has expired.
InvalidArgument Parameter format error.
InvalidAccessKeyId The AccessKeyID does not exist.
InvalidBucketName The bucket name is invalid.
InvalidDigest The digest is invalid.
InvalidObjectName The object name is invalid.
InvalidPart A part is invalid.
InvalidPartOrder The part order is invalid.
InvalidTargetBucketForLogging The logging operation has an invalid target bucket.
InternalError Internal OSS error.
MalformedXML Invalid XML format.
MethodNotAllowed The method is not supported.
MissingArgument A parameter is missing.
MissingContentLength The content length is missing.
NoSuchBucket The bucket does not exist.
NoSuchKey The object does not exist.
NoSuchUpload The Multipart Upload ID does not exist.
NotImplemented The method cannot be processed.
PreconditionFailed Pre-processing error.
RequestTimeTooSkewed The request initiation time exceeds the server time by 15 minutes.
RequestTimeout Request timed out.
SignatureDoesNotMatch Signature error.
TooManyBuckets The user’s bucket quantity exceeds the limit.
Thank you! We've received your feedback.