iOS开发之--NSError错误码
1、AFN NSURLErrorDomain 错误编码
typedef enum { NSURLErrorUnknown = -1, //未知 NSURLErrorCancelled = -999, //取消 NSURLErrorBadURL = -1000, //错误URL NSURLErrorTimedOut = -1001, //超时 NSURLErrorUnsupportedURL = -1002, //不支持URL NSURLErrorCannotFindHost = -1003, //找不到主机 NSURLErrorCannotConnectToHost = -1004, //无法连接到主机 NSURLErrorDataLengthExceedsMaximum = -1103, //数据长度超过最大值 NSURLErrorNetworkConnectionLost = -1005, //网络连接丢失 NSURLErrorDNSLookupFailed = -1006, //DNS查询失败 NSURLErrorHTTPTooManyRedirects = -1007, //HTTP重定向太多 NSURLErrorResourceUnavailable = -1008, //资源不可用 NSURLErrorNotConnectedToInternet = -1009, //未连接到互联网的NSURL错误 NSURLErrorRedirectToNonExistentLocation = -1010, //重定向到不存在的位置 NSURLErrorBadServerResponse = -1011, //服务器响应错误 NSURLErrorUserCancelledAuthentication = -1012,//用户取消身份验证 NSURLErrorUserAuthenticationRequired = -1013, NSURLErrorZeroByteResource = -1014, //0字节资源 NSURLErrorCannotDecodeRawData = -1015,//无法解码原始数据 NSURLErrorCannotDecodeContentData = -1016,//无法解码内容数据 NSURLErrorCannotParseResponse = -1017, //无法解析响应 NSURLErrorFileDoesNotExist = -1100,//文件不存在 NSURLErrorFileIsDirectory = -1101,//文件目录 NSURLErrorNoPermissionsToReadFile = -1102,//没有权限读取文件 NSURLErrorSecureConnectionFailed = -1200, //安全连接失败 NSURLErrorServerCertificateHasBadDate = -1201, //服务器证书错误日期 NSURLErrorServerCertificateUntrusted = -1202,//服务器证书不可信 NSURLErrorServerCertificateHasUnknownRoot = -1203,//服务器证书有未知的根 NSURLErrorServerCertificateNotYetValid = -1204,//服务器证书无效 NSURLErrorClientCertificateRejected = -1205,//客户端证书拒绝 NSURLErrorClientCertificateRequired = -1206, //客户端证书要求 NSURLErrorCannotLoadFromNetwork = -2000,//无法从网络加载 NSURLErrorCannotCreateFile = -3000,//无法创建文件 NSURLErrorCannotOpenFile = -3001,//无法打开文件 NSURLErrorCannotCloseFile = -3002,//无法关闭文件 NSURLErrorCannotWriteToFile = -3003,//无法写入文件 NSURLErrorCannotRemoveFile = -3004,//无法删除文件 NSURLErrorCannotMoveFile = -3005,//无法移动文件 NSURLErrorDownloadDecodingFailedMidStream = -3006,//下载解码失败中流 NSURLErrorDownloadDecodingFailedToComplete = -3007//下载解码失败 }
2、Cocoa框架错误域问题
enum { NSFileNoSuchFileError = 4, //没有这样的文件错误 NSFileLockingError = 255, //文件锁定错误 NSFileReadUnknownError = 256,//文件读取未知错误 NSFileReadNoPermissionError = 257,//文件读取无权限错误 NSFileReadInvalidFileNameError = 258,//文件读取无效文件名错误 NSFileReadCorruptFileError = 259,//文件读取损坏文件错误 NSFileReadNoSuchFileError = 260,//文件读取无此类文件错误 NSFileReadInapplicableStringEncodingError = 261,//文件读取不适用字符串编码错误 NSFileReadUnsupportedSchemeError = 262,//文件读取不支持方案错误 NSFileReadTooLargeError = 263,//文件读取太大错误 NSFileReadUnknownStringEncodingError = 264,//文件读取未知字符串编码错误 NSFileWriteUnknownError = 512,//文件写入未知错误 NSFileWriteNoPermissionError = 513,//文件写无权限错误 NSFileWriteInvalidFileNameError = 514,//文件写入无效文件名错误 NSFileWriteInapplicableStringEncodingError = 517,//文件写入不适用字符串编码错误 NSFileWriteUnsupportedSchemeError = 518,//文件写不支持方案错误 NSFileWriteOutOfSpaceError = 640,//文件写空错误 NSFileWriteVolumeReadOnlyError = 642m,//文件写卷只读错误 NSKeyValueValidationError = 1024,//NS键值验证错误 NSFormattingError = 2048,//格式错误 NSUserCancelledError = 3072,//用户取消错误 NSFileErrorMinimum = 0,//文件错误最小值 NSFileErrorMaximum = 1023,//文件错误最大值 NSValidationErrorMinimum = 1024,//验证误差最小 NSValidationErrorMaximum = 2047,//验证误差最大值 NSFormattingErrorMinimum = 2048,//格式错误最小值 NSFormattingErrorMaximum = 2559,//格式化错误最大值 NSPropertyListReadCorruptError = 3840,//属性列表读取损坏错误 NSPropertyListReadUnknownVersionError = 3841,//属性列表读取未知版本错误 NSPropertyListReadStreamError = 3842,//属性列表读取流错误 NSPropertyListWriteStreamError = 3851,//写入流错误 NSPropertyListErrorMinimum = 3840,//属性列表错误最小值 NSPropertyListErrorMaximum = 4095,//属性列表错误最大值 NSExecutableErrorMinimum = 3584,//可执行错误最小值 NSExecutableNotLoadableError = 3584,//可执行文件不可加载错误 NSExecutableArchitectureMismatchError = 3585,//可执行架构不匹配错误 NSExecutableRuntimeMismatchError = 3586,//可执行运行时不匹配错误 NSExecutableLoadError = 3587,//可执行加载错误 NSExecutableLinkError = 3588,//可执行链接错误 NSExecutableErrorMaximum = 3839,//可执行错误最大值 }
仅做记录!
本文来自博客园,作者:稻草人11223,转载请注明原文链接:https://www.cnblogs.com/hero11223/p/13156248.html