All Products
Search
Document Center

Object Storage Service:Exception responses (iOS SDK)

Last Updated:Mar 20, 2026

The OSS iOS SDK returns two types of exceptions: ClientError and ServerError.

  • `ClientError`: originates on the device — parameter validation failures, network issues, file I/O errors, and task cancellations.

  • `ServerError`: originates on the OSS server — the server received the request but returned an error HTTP status code.

This page covers all ClientError codes and common ServerError patterns. For the full list of OSS server-side error codes, see OSS error codes.

Client errors

All client errors share the error domain com.aliyun.oss.clientError.

CodeConstantDescriptionResolution
0OSSClientErrorCodeNetworkingFailWithResponseCode0Connection failed with response code 0.Check network connectivity and retry.
1OSSClientErrorCodeSignFailedRequest signature failed.See Troubleshoot signature errors.
2OSSClientErrorCodeFileCantWriteFailed to write to the file.The breakpoint record path or download destination path is invalid. Correct the file path and retry.
3OSSClientErrorCodeInvalidArgumentInvalid parameter value or format.Check the parameter format against the API reference and correct the value.
4OSSClientErrorCodeNilUploadidFailed to get the uploadId for a resumable upload.Verify that parameters such as objectMeta are correct, then retry.
5OSSClientErrorCodeTaskCancelledTask was canceled.Check whether your cancellation logic is intentional or triggered by a network issue.
6OSSClientErrorCodeNetworkErrorNetwork exception.Check network connectivity and retry.
7OSSClientErrorCodeInvalidCRCCyclic redundancy check (CRC) failed.Data inconsistency occurred during transfer. Verify that the file was not modified during transfer and retry.
8OSSClientErrorCodeCannotResumeUploadResumable upload cannot continue.The file changed during upload, causing a size mismatch. Do not modify the file while an upload is in progress.
9OSSClientErrorCodeExcpetionCatchedException caught.Check the full error message for details and troubleshoot accordingly.

Server errors

Server errors use the error domain com.aliyun.oss.serverError. The error code is -1 × httpResponse.statusCode and the UserInfo dictionary contains the parsed XML response body.

The server may have encountered an error and could not complete the request. For more information, see OSS error codes.