URL Loading System Error Codes
NSURLErrorDomain에서 정의하는 NSError의 에러코드들은 아래와 같다.
enum
{
NSURLErrorUnknown = -1,
NSURLErrorCancelled = -999,
NSURLErrorBadURL = -1000,
NSURLErrorTimedOut = -1001,
NSURLErrorUnsupportedURL = -1002,
NSURLErrorCannotFindHost = -1003,
NSURLErrorCannotConnectToHost = -1004,
NSURLErrorDataLengthExceedsMaximum = -1103,
NSURLErrorNetworkConnectionLost = -1005,
NSURLErrorDNSLookupFailed = -1006,
NSURLErrorHTTPTooManyRedirects = -1007,
NSURLErrorResourceUnavailable = -1008,
NSURLErrorNotConnectedToInternet = -1009,
NSURLErrorRedirectToNonExistentLocation = -1010,
NSURLErrorBadServerResponse = -1011,
NSURLErrorUserCancelledAuthentication = -1012,
NSURLErrorUserAuthenticationRequired = -1013,
NSURLErrorZeroByteResource = -1014,
NSURLErrorCannotDecodeRawData = -1015,
NSURLErrorCannotDecodeContentData = -1016,
NSURLErrorCannotParseResponse = -1017,
NSURLErrorInternationalRoamingOff = -1018,
NSURLErrorCallIsActive = -1019,
NSURLErrorDataNotAllowed = -1020,
NSURLErrorRequestBodyStreamExhausted = -1021,
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
}
엄청 많타!@
NSURLErrorUnknown
시스템에 정의되지 않은 에러. 이 에러가 나면 프레임웍이나 라이브러리의 문제로 애플에 보고해달란다.Available in Mac OS X v10.2 and later.
NSURLErrorCancelled
로드중에 취소하면 발생
NSURLConnection이나 NSURLDownload는 download가 취소된 경우에는 발생하지 않는다.
Available in Mac OS X v10.2 and later.
NSURLErrorBadURL
잘못된 URL form으로 접근시도시 발생.
Available in Mac OS X v10.2 and later.
NSURLErrorTimedOut
페이지 로딩이 완료되기 전에 지정한 시간이 지나면 발생.
Available in Mac OS X v10.2 and later.
NSURLErrorUnsupportedURL
URL폼이 프레임웍에서 지원하지 않는 경우, 유효하지 않은 프로토콜입력시 발생 가능함.
Available in Mac OS X v10.2 and later.
NSURLErrorCannotFindHost
URL에서 지정하는 host name을 찾지 못한 경우
Available in Mac OS X v10.2 and later.
NSURLErrorCannotConnectToHost
호스트 연결이 실패한 경우. 호스트이름은 찾았는데 호스트가 다운되어 있거나 해당 포트에 연결 제한이 걸려 연결이 안된 경우에 발생 가능하다.
Available in Mac OS X v10.2 and later.
NSURLErrorDataLengthExceedsMaximum
요청단 데이터가 길이제한을 상회한 경우
Available in Mac OS X v10.5 and later.
NSURLErrorNetworkConnectionLost
서버와의 연결이 로드중에 문제가 발생한 경우
Available in Mac OS X v10.2 and later.
NSURLErrorDNSLookupFailed
See
NSURLErrorCannotFindHost
Available in Mac OS X v10.2 and later.
NSURLErrorHTTPTooManyRedirects
redirection이 발생한 경우 또는 16회 이상이 발생한 경우
Available in Mac OS X v10.2 and later.
NSURLErrorResourceUnavailable
요청한 리소스를 찾을 수 없는 경우, 예: "file not found", data decoding error등
Available in Mac OS X v10.2 and later.
NSURLErrorNotConnectedToInternet
네트웍을 요청하였는데 인터넷연결이 안된경우, 자동연결시도가 실패한경우, 연결상태가 안좋은 경우, 또는 사용자가 네트웍연결을 자동으로 선택하지 안은 경우 발생
Available in Mac OS X v10.2 and later.
NSURLErrorRedirectToNonExistentLocation
서버에서 잘못된 redirect를 한경우
Available in Mac OS X v10.2 and later.
NSURLErrorBadServerResponse
서버로부터 잘못된 데이터를 수신한경우. "500 server error"에 대응된다.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorUserCancelledAuthentication
인증과정 중 사용자가 취소한 경우 발생.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorUserAuthenticationRequired
인증인 리소스에 접근이 필요할 때 발생
Available in Mac OS X v10.2 and later.Declared in
NSURLError.h
.NSURLErrorZeroByteResource
Returned when a server reports that a URL has a non-zero content length, but terminates the network connection “gracefully” without sending any data.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotDecodeRawData
Returned when content data received during an NSURLConnection request cannot be decoded for a known content encoding.
Available in Mac OS X v10.5 and later.
Declared in
NSURLError.h
.NSURLErrorCannotDecodeContentData
Returned when content data received during an NSURLConnection request has an unknown content encoding.
Available in Mac OS X v10.5 and later.
Declared in
NSURLError.h
.NSURLErrorCannotParseResponse
Returned when a response to an NSURLConnection request cannot be parsed.
Available in Mac OS X v10.5 and later.
Declared in
NSURLError.h
.NSURLErrorInternationalRoamingOff
Returned when a connection would require activating a data context while roaming, but international roaming is disabled.
Available in Mac OS X v10.7 and later.
Declared in
NSURLError.h
.NSURLErrorCallIsActive
Returned when a connection is attempted while a phone call is active on a network that does not support simultaneous phone and data communication (EDGE or GPRS).
Available in Mac OS X v10.7 and later.
Declared in
NSURLError.h
.NSURLErrorDataNotAllowed
Returned when the cellular network disallows a connection.
Available in Mac OS X v10.7 and later.
Declared in
NSURLError.h
.NSURLErrorRequestBodyStreamExhausted
Returned when a body stream is needed but the client does not provide one. This impacts clients on iOS that send a POST request using a body stream but do not implement the NSURLConnection delegate method
connection:needNewBodyStream
.Available in Mac OS X v10.7 and later.
Declared in
NSURLError.h
.NSURLErrorFileDoesNotExist
Returned when a file does not exist.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorFileIsDirectory
Returned when a request for an FTP file results in the server responding that the file is not a plain file, but a directory.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorNoPermissionsToReadFile
Returned when a resource cannot be read due to insufficient permissions.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorSecureConnectionFailed
Returned when an attempt to establish a secure connection fails for reasons which cannot be expressed more specifically.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorServerCertificateHasBadDate
Returned when a server certificate has a date which indicates it has expired, or is not yet valid.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorServerCertificateUntrusted
Returned when a server certificate is signed by a root server which is not trusted.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorServerCertificateHasUnknownRoot
Returned when a server certificate is not signed by any root server.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorServerCertificateNotYetValid
Returned when a server certificate is not yet valid.
Available in Mac OS X v10.4 and later.
Declared in
NSURLError.h
.NSURLErrorClientCertificateRejected
Returned when a server certificate is rejected.
Available in Mac OS X v10.4 and later.
Declared in
NSURLError.h
.NSURLErrorClientCertificateRequired
Returned when a client certificate is required to authenticate an SSL connection during an NSURLConnection request.
Available in Mac OS X v10.6 and later.
Declared in
NSURLError.h
.NSURLErrorCannotLoadFromNetwork
Returned when a specific request to load an item only from the cache cannot be satisfied.
This error is sent at the point when the library would go to the network accept for the fact that is has been blocked from doing so by the “load only from cache” directive.
Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotCreateFile
Returned when
NSURLDownload
object was unable to create the downloaded file on disk due to a I/O failure.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotOpenFile
Returned when
NSURLDownload
was unable to open the downloaded file on disk.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotCloseFile
Returned when
NSURLDownload
was unable to close the downloaded file on disk.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotWriteToFile
Returned when
NSURLDownload
was unable to write to the downloaded file on disk.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotRemoveFile
Returned when
NSURLDownload
was unable to remove a downloaded file from disk.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorCannotMoveFile
Returned when
NSURLDownload
was unable to move a downloaded file on disk.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorDownloadDecodingFailedMidStream
Returned when
NSURLDownload
failed to decode an encoded file during the download.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.NSURLErrorDownloadDecodingFailedToComplete
Returned when
NSURLDownload
failed to decode an encoded file after downloading.Available in Mac OS X v10.2 and later.
Declared in
NSURLError.h
.
Availability
- Available in Mac OS X v10.2 with Safari 1.0 installed.
- Available in Mac OS X v10.2.7 and later.
Declared In
NSURLError.h