Apple NSURL网络错误码

/*!

    @enum NSURL-related Error Codes

    @abstract Constants used by NSError to indicate errors in the WebFoundation domain

    @discussion Documentation on each constant forthcoming.

*/

enum

{

    NSURLErrorUnknown = -1,

    NSURLErrorCancelled = kCFURLErrorCancelled,

    NSURLErrorBadURL = kCFURLErrorBadURL,

    NSURLErrorTimedOut = kCFURLErrorTimedOut,

    NSURLErrorUnsupportedURL = kCFURLErrorUnsupportedURL,

    NSURLErrorCannotFindHost = kCFURLErrorCannotFindHost,

    NSURLErrorCannotConnectToHost = kCFURLErrorCannotConnectToHost,

    NSURLErrorNetworkConnectionLost = kCFURLErrorNetworkConnectionLost,

    NSURLErrorDNSLookupFailed = kCFURLErrorDNSLookupFailed,

    NSURLErrorHTTPTooManyRedirects = kCFURLErrorHTTPTooManyRedirects,

    NSURLErrorResourceUnavailable = kCFURLErrorResourceUnavailable,

    NSURLErrorNotConnectedToInternet = kCFURLErrorNotConnectedToInternet,

    NSURLErrorRedirectToNonExistentLocation = kCFURLErrorRedirectToNonExistentLocation,

    NSURLErrorBadServerResponse = kCFURLErrorBadServerResponse,

    NSURLErrorUserCancelledAuthentication = kCFURLErrorUserCancelledAuthentication,

    NSURLErrorUserAuthenticationRequired = kCFURLErrorUserAuthenticationRequired,

    NSURLErrorZeroByteResource = kCFURLErrorZeroByteResource,

    NSURLErrorCannotDecodeRawData =             kCFURLErrorCannotDecodeRawData,

    NSURLErrorCannotDecodeContentData =         kCFURLErrorCannotDecodeContentData,

    NSURLErrorCannotParseResponse =             kCFURLErrorCannotParseResponse,

    NSURLErrorFileDoesNotExist = kCFURLErrorFileDoesNotExist,

    NSURLErrorFileIsDirectory = kCFURLErrorFileIsDirectory,

    NSURLErrorNoPermissionsToReadFile = kCFURLErrorNoPermissionsToReadFile,

    NSURLErrorDataLengthExceedsMaximum NS_ENUM_AVAILABLE(10_5, 2_0) = kCFURLErrorDataLengthExceedsMaximum,

    

    // SSL errors

    NSURLErrorSecureConnectionFailed = kCFURLErrorSecureConnectionFailed,

    NSURLErrorServerCertificateHasBadDate = kCFURLErrorServerCertificateHasBadDate,

    NSURLErrorServerCertificateUntrusted = kCFURLErrorServerCertificateUntrusted,

    NSURLErrorServerCertificateHasUnknownRoot = kCFURLErrorServerCertificateHasUnknownRoot,

    NSURLErrorServerCertificateNotYetValid = kCFURLErrorServerCertificateNotYetValid,

    NSURLErrorClientCertificateRejected = kCFURLErrorClientCertificateRejected,

    NSURLErrorClientCertificateRequired = kCFURLErrorClientCertificateRequired,

    NSURLErrorCannotLoadFromNetwork = kCFURLErrorCannotLoadFromNetwork,

    

    // Download and file I/O errors

    NSURLErrorCannotCreateFile = kCFURLErrorCannotCreateFile,

    NSURLErrorCannotOpenFile = kCFURLErrorCannotOpenFile,

    NSURLErrorCannotCloseFile = kCFURLErrorCannotCloseFile,

    NSURLErrorCannotWriteToFile = kCFURLErrorCannotWriteToFile,

    NSURLErrorCannotRemoveFile = kCFURLErrorCannotRemoveFile,

    NSURLErrorCannotMoveFile = kCFURLErrorCannotMoveFile,

    NSURLErrorDownloadDecodingFailedMidStream = kCFURLErrorDownloadDecodingFailedMidStream,

    NSURLErrorDownloadDecodingFailedToComplete =kCFURLErrorDownloadDecodingFailedToComplete,


    NSURLErrorInternationalRoamingOff NS_ENUM_AVAILABLE(10_7, 3_0) =         kCFURLErrorInternationalRoamingOff,

    NSURLErrorCallIsActive NS_ENUM_AVAILABLE(10_7, 3_0) =                    kCFURLErrorCallIsActive,

    NSURLErrorDataNotAllowed NS_ENUM_AVAILABLE(10_7, 3_0) =                  kCFURLErrorDataNotAllowed,

    NSURLErrorRequestBodyStreamExhausted NS_ENUM_AVAILABLE(10_7, 3_0) =      kCFURLErrorRequestBodyStreamExhausted,

    

    NSURLErrorBackgroundSessionRequiresSharedContainer NS_ENUM_AVAILABLE(10_10, 8_0) = -995,

    NSURLErrorBackgroundSessionInUseByAnotherProcess NS_ENUM_AVAILABLE(10_10, 8_0) = -996,

    NSURLErrorBackgroundSessionWasDisconnected NS_ENUM_AVAILABLE(10_10, 8_0)= -997,

};

没有更多推荐了,返回首页