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

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

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