Exception handling

Last Updated: Aug 10, 2017

There are two types of exceptions in the SDK: ClientError and ServerError. ClientError includes parameter errors and network errors, and ServerError refers to an exceptional response returned by the OSS Server.

Error typeError DomainCodeUserInfo
ClientError
com.aliyun.oss.clientErrorOSSClientErrorCodeNetworkingFailWithResponseCode0Connection exception
OSSClientErrorCodeSignFailedFailed signature
OSSClientErrorCodeFileCantWriteFailed to write a file
OSSClientErrorCodeInvalidArgumentInvalid parameter
OSSClientErrorCodeNilUploadidFailed to obtain the upload ID of a resumable upload task
OSSClientErrorCodeTaskCancelledTask canceled
OSSClientErrorCodeNetworkErrorNetwork exception
OSSClientErrorCodeCannotResumeUploadResumable upload failed and discontinued
OSSClientErrorCodeNotKnownUnknown exception
ServerErrorcom.aliyun.oss.serverError(-1 * httpResponseCode)Dictionary obtained by resolving a response in the XML format
Thank you! We've received your feedback.