All Products
Search
Document Center

Object Storage Service:Handle exceptions

Last Updated:Aug 12, 2024

There are two types of exceptions in the iOS SDK: ClientError and ServerError.

ClientError indicates parameter and network errors. ServerError indicates abnormal responses from the OSS server.

Error typeError domainCodeUserInfoDescriptionSolution
ClientErrorcom.aliyun.oss.clientError0OSSClientErrorCodeNetworkingFailWithResponseCode0The network connection is abnormal. Check the network connection and try again.
1OSSClientErrorCodeSignFailedA signature failure occurs. For more information about troubleshooting, see Troubleshoot signature errors.
2OSSClientErrorCodeFileCantWriteThe object fails to be written to the server. The path of the checkpoint file for upload or download or the path of the object to be download may be invalid. Modify the corresponding path and try again.
3OSSClientErrorCodeInvalidArgumentThe parameter is invalid. The parameter format is incorrect. For more information about the parameter format, see List of operations by function.
4OSSClientErrorCodeNilUploadidThe upload ID for the resumable upload task fails to be obtained.Check the parameters. For example, check whether the object metadata is correct. Try again.
5OSSClientErrorCodeTaskCancelledThe task is canceled.Check whether the logic used to cancel the task is correct or whether the network connection is normal.
6OSSClientErrorCodeNetworkErrorThe network is abnormal. Check the network connection and try again.
7OSSClientErrorCodeInvalidCRCThe CRC check fails.Data is inconsistent during transfer. Check whether the object is modified.
8OSSClientErrorCodeCannotResumeUploadThe resumable upload task fails.The object is modified during upload, causing inconsistency in the size of the object. Do not modify the object during upload.
9OSSClientErrorCodeExcpetionCatchedAn exception is captured. Troubleshoot the error based on the specific error information.
ServerErrorcom.aliyun.oss.serverError(-1 * httpResponse. statusCode)dictThe directory obtained by parsing the corresponding XML file.An error may occur on the server, causing the server unable to complete the request. For more information about troubleshooting, see Overview.