SDK中发生的异常分为两类:ClientError和ServerError。

ClientError指参数错误、网络错误等。ServerError指OSS Server返回的异常响应。

Error类型 Error Domain Code UserInfo
ClientError
com.aliyun.oss.clientError OSSClientErrorCodeNetworkingFailWithResponseCode0 连接异常
OSSClientErrorCodeSignFailed 签名失败
OSSClientErrorCodeFileCantWrite 文件无法写入
OSSClientErrorCodeInvalidArgument 参数非法
OSSClientErrorCodeNilUploadid 断点续传任务未获取到uploadId
OSSClientErrorCodeTaskCancelled 任务被取消
OSSClientErrorCodeNetworkError 网络异常
OSSClientErrorCodeCannotResumeUpload 断点上传失败,无法继续上传
OSSClientErrorCodeNotKnown 未知异常
ServerError com.aliyun.oss.serverError (-1 * httpResponseCode) 解析响应XML得到的Dictionary