ios中網(wǎng)絡請求error錯誤匯總

在網(wǎng)絡請求的時候會遇到很多請求錯誤, AFN會返回error錯誤的代碼 ,整理出來方便查詢
:)
也可以參考維基維基百科 List of HTTP status codes


Error Code Description
1 </br> kCFHostErrorHostNotFound “Indicates that the DNS lookup failed.”
2 </br> kCFHostErrorUnknown “An unknown error occurred (a name server failure, for example). For additional information, query the kCFGetAddrInfoFailureKey to get the value returned from getaddrinfo; lookup in netdb.h”
100 </br> kCFSOCKSErrorUnknownClientVersion “The SOCKS server rejected access because it does not support connections with the requested SOCKS version.Query kCFSOCKSStatusCodeKey to recover the status code returned by the server.”
101 </br> kCFSOCKSErrorUnsupportedServerVersion “The version of SOCKS requested by the server is not supported. Query kCFSOCKSStatusCodeKey to recover the status code returned by the server. Query the kCFSOCKSVersionKey to find the version requested by the server.”

SOCKS4 Code Description
110 </br> kCFSOCKS4ErrorRequestFailed “Request rejected or failed by the server.”
111 </br> kCFSOCKS4ErrorIdentdFailed “Request rejected because SOCKS server cannot connect to identd on the client.”
112 </br> kCFSOCKS4ErrorIdConflict “Request rejected because the client program and identd report different user-ids.”
113 </br> kCFSOCKS4ErrorUnknownStatusCode “The status code returned by the server is unknown.”

SOCKS5 Code Description
120</br> kCFSOCKS5ErrorBadState “The stream is not in a state that allows the requested operation.”
121</br> kCFSOCKS5ErrorBadResponseAddr “The address type returned is not supported.”
122</br> kCFSOCKS5ErrorBadCredentials “The SOCKS server refused the client connection because of bad login credentials.”
123</br> kCFSOCKS5ErrorUnsupportedNegotiationMethod “The requested method is not supported. Query kCFSOCKSNegotiationMethodKey to find the method requested.”
124 </br> kCFSOCKS5ErrorNoAcceptableMethod “The client and server could not find a mutually agreeable authentication method.”

HTTP Code Description
300 </br>kCFErrorHTTPAuthenticationTypeUnsupported “The client and server could not agree on a supported authentication type.”
301 </br> kCFErrorHTTPBadCredentials “The credentials provided for an authenticated connection were rejected by the server.”
302 </br> kCFErrorHTTPConnectionLost “The connection to the server was dropped. This usually indicates a highly overloaded server.”
303 </br> kCFErrorHTTPParseFailure “The HTTP server response could not be parsed.”
304 </br>kCFErrorHTTPRedirectionLoopDetected “Too many HTTP redirects occurred before reaching a page that did not redirect the client to another page. This usually indicates a redirect loop.”
305 </br> kCFErrorHTTPBadURL “The requested URL could not be retrieved.”
306 </br> kCFErrorHTTPProxyConnectionFailure “A connection could not be established to the HTTP proxy.”
307 </br> kCFErrorHTTPBadProxyCredentials “The authentication credentials provided for logging into the proxy were rejected.”
308 </br> kCFErrorPACFileError “An error occurred with the proxy autoconfiguration file.”
309</br> kCFErrorPACFileAuth “The authentication credentials provided by the proxy autoconfiguration file were rejected.”
310 </br> kCFErrorHTTPSProxyConnectionFailure “A connection could not be established to the HTTPS proxy.”
311 </br> kCFStreamErrorHTTPSProxyFailureUnexpectedResponseToCONNECTMethod “The HTTPS proxy returned an unexpected status code, such as a 3xx redirect.”

CFURLConnection Code Description
-998 </br> kCFURLErrorUnknown “An unknown error occurred.”
-999 </br> kCFURLErrorCancelled </br>NSURLErrorCancelled “The connection was cancelled.”
-1000</br>kCFURLErrorBadURL</br>NSURLErrorBadURL “The connection failed due to a malformed URL.”
-1001</br>kCFURLErrorTimedOut</br>NSURLErrorTimedOut “The connection timed out.”
-1002</br>kCFURLErrorUnsupportedURL</br>NSURLErrorUnsupportedURL “The connection failed due to an unsupported URL scheme.”
-1003</br>kCFURLErrorCannotFindHost</br>NSURLErrorCannotFindHost “The connection failed because the host could not be found.”
-1004</br>kCFURLErrorCannotConnectToHost</br>NSURLErrorCannotConnectToHost “The connection failed because a connection cannot be made to the host.”
-1005</br>kCFURLErrorNetworkConnectionLost</br>NSURLErrorNetworkConnectionLost “The connection failed because the network connection was lost.”
-1006</br>kCFURLErrorDNSLookupFailed</br>NSURLErrorDNSLookupFailed “The connection failed because the DNS lookup failed.”
-1007</br>kCFURLErrorHTTPTooManyRedirects</br>NSURLErrorHTTPTooManyRedirects “The HTTP connection failed due to too many redirects.”
-1008</br>kCFURLErrorResourceUnavailable</br>NSURLErrorResourceUnavailable “The connection’s resource is unavailable.”
-1009</br>kCFURLErrorNotConnectedToInternet</br>NSURLErrorNotConnectedToInternet “The connection failed because the device is not connected to the internet.”
-1010</br>kCFURLErrorRedirectToNonExistentLocation</br>NSURLErrorRedirectToNonExistentLocation “The connection was redirected to a nonexistent location.”
-1011</br>kCFURLErrorBadServerResponse</br>NSURLErrorBadServerResponse “The connection received an invalid server response.”
-1012</br>kCFURLErrorUserCancelledAuthentication</br>NSURLErrorUserCancelledAuthentication “The connection failed because the user cancelled required authentication.”
-1013</br>kCFURLErrorUserAuthenticationRequired</br>NSURLErrorUserAuthenticationRequired “The connection failed because authentication is required.”
-1014</br>kCFURLErrorZeroByteResource</br>NSURLErrorZeroByteResource “The resource retrieved by the connection is zero bytes.”
-1015</br>kCFURLErrorCannotDecodeRawData</br>NSURLErrorCannotDecodeRawData “The connection cannot decode data encoded with a known content encoding.”
1016</br>kCFURLErrorCannotDecodeContentData</br>NSURLErrorCannotDecodeContentData “The connection cannot decode data encoded with an unknown content encoding.”
-1017</br>kCFURLErrorCannotParseResponse</br>NSURLErrorCannotParseResponse “The connection cannot parse the server’s response.”
-1018</br> kCFURLErrorInternationalRoamingOff “The connection failed because international roaming is disabled on the device.”
-1019</br> kCFURLErrorCallIsActive “The connection failed because a call is active.”
-1020</br> kCFURLErrorDataNotAllowed “The connection failed because data use is currently not allowed on the device.”
-1021</br> kCFURLErrorRequestBodyStreamExhausted “The connection failed because its request’s body stream was exhausted.”

File Code Description
-1100</br>kCFURLErrorFileDoesNotExist</br>NSURLErrorFileDoesNotExist “The file operation failed because the file does not exist.”
-1101</br>kCFURLErrorFileIsDirectory</br>NSURLErrorFileIsDirectory “The file operation failed because the file is a directory.”
-1102</br>kCFURLErrorNoPermissionsToReadFile</br>NSURLErrorNoPermissionsToReadFile “The file operation failed because it does not have permission to read the file.”
-1103</br>kCFURLErrorDataLengthExceedsMaximum</br>NSURLErrorDataLengthExceedsMaximum “The file operation failed because the file is too large.”

SSL Code Description
-1200</br>kCFURLErrorSecureConnectionFailed</br>NSURLErrorSecureConnectionFailed “The secure connection failed for an unknown reason.”
-1201</br>kCFURLErrorServerCertificateHasBadDate</br>NSURLErrorServerCertificateHasBadDate “The secure connection failed because the server’s certificate has an invalid date.”
-1202</br>kCFURLErrorServerCertificateUntrusted</br>NSURLErrorServerCertificateUntrusted “The secure connection failed because the server’s certificate is not trusted.”
-1203</br>kCFURLErrorServerCertificateHasUnknownRoot</br>NSURLErrorServerCertificateHasUnknownRoot “The secure connection failed because the server’s certificate has an unknown root.”
-1204</br>kCFURLErrorServerCertificateNotYetValid</br>NSURLErrorServerCertificateNotYetValid “The secure connection failed because the server’s certificate is not yet valid.”
-1205</br>kCFURLErrorClientCertificateRejected</br>NSURLErrorClientCertificateRejected “The secure connection failed because the client’s certificate was rejected.”
-1206</br>kCFURLErrorClientCertificateRequired</br>NSURLErrorClientCertificateRequired “The secure connection failed because the server requires a client certificate.”

Download I/O Code Description
-2000</br>kCFURLErrorCannotLoadFromNetwork</br>NSURLErrorCannotLoadFromNetwork “The connection failed because it is being required to return a cached resource, but one is not available.”
-3000</br>kCFURLErrorCannotCreateFile</br>NSURLErrorCannotCreateFile “The file cannot be created.”
-3001</br>kCFURLErrorCannotOpenFile</br>NSURLErrorCannotOpenFile “The file cannot be opened.”
-3002</br>kCFURLErrorCannotCloseFile</br>NSURLErrorCannotCloseFile “The file cannot be closed.”
-3003</br>kCFURLErrorCannotWriteToFile</br>NSURLErrorCannotWriteToFile “The file cannot be written.”
-3004</br>kCFURLErrorCannotRemoveFile</br>NSURLErrorCannotRemoveFile “The file cannot be removed.”
-3005</br>kCFURLErrorCannotMoveFile</br>NSURLErrorCannotMoveFile “The file cannot be moved.”
-3006</br>kCFURLErrorDownloadDecodingFailedMidStream</br>NSURLErrorDownloadDecodingFailedMidStream “The download failed because decoding of the downloaded data failed mid-stream.”
-3007</br>kCFURLErrorDownloadDecodingFailedToComplete</br>NSURLErrorDownloadDecodingFailedToComplete “The download failed because decoding of the downloaded data failed to complete.”
3840 “JSON text did not start with array or object and option to allow fragments not set.”

Cookie Code Description
-4000</br>kCFHTTPCookieCannotParseCookieFile “The cookie file cannot be parsed.”

CFNetServices Code Description
-72000L</br> kCFNetServiceErrorUnknown “An unknown error occurred.”
72001L</br> kCFNetServiceErrorCollision “An attempt was made to use a name that is already in use.”
-72002L</br> kCFNetServiceErrorNotFound “Not used.”
72003L</br>kCFNetServiceErrorInProgress “A new search could not be started because a search is already in progress.”
-72004L</br> kCFNetServiceErrorBadArgument “A required argument was not provided or was not valid.”
-72005L</br> kCFNetServiceErrorCancel “The search or service was cancelled.”
-72006L</br> kCFNetServiceErrorInvalid “Invalid data was passed to a CFNetServices function.”
-72007L</br> kCFNetServiceErrorTimeout “A search failed because it timed out.”
-73000L</br> kCFNetServiceErrorDNSServiceFailure “An error from DNS discovery; look at kCFDNSServiceFailureKey to get the error number and interpret using dnssd.h”
最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末拳喻,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子戒财,更是在濱河造成了極大的恐慌烂瘫,老刑警劉巖舔痕,帶你破解...
    沈念sama閱讀 219,110評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異,居然都是意外死亡邻寿,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,443評論 3 395
  • 文/潘曉璐 我一進店門视哑,熙熙樓的掌柜王于貴愁眉苦臉地迎上來绣否,“玉大人,你說我怎么就攤上這事挡毅∷獯椋” “怎么了?”我有些...
    開封第一講書人閱讀 165,474評論 0 356
  • 文/不壞的土叔 我叫張陵跪呈,是天一觀的道長段磨。 經(jīng)常有香客問我,道長耗绿,這世上最難降的妖魔是什么苹支? 我笑而不...
    開封第一講書人閱讀 58,881評論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮误阻,結果婚禮上债蜜,老公的妹妹穿的比我還像新娘。我一直安慰自己究反,他們只是感情好策幼,可當我...
    茶點故事閱讀 67,902評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著奴紧,像睡著了一般特姐。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上黍氮,一...
    開封第一講書人閱讀 51,698評論 1 305
  • 那天唐含,我揣著相機與錄音,去河邊找鬼沫浆。 笑死捷枯,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的专执。 我是一名探鬼主播淮捆,決...
    沈念sama閱讀 40,418評論 3 419
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了攀痊?” 一聲冷哼從身側響起桐腌,我...
    開封第一講書人閱讀 39,332評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎苟径,沒想到半個月后案站,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,796評論 1 316
  • 正文 獨居荒郊野嶺守林人離奇死亡棘街,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,968評論 3 337
  • 正文 我和宋清朗相戀三年蟆盐,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片遭殉。...
    茶點故事閱讀 40,110評論 1 351
  • 序言:一個原本活蹦亂跳的男人離奇死亡石挂,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出险污,到底是詐尸還是另有隱情痹愚,我是刑警寧澤,帶...
    沈念sama閱讀 35,792評論 5 346
  • 正文 年R本政府宣布罗心,位于F島的核電站里伯,受9級特大地震影響城瞎,放射性物質發(fā)生泄漏渤闷。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,455評論 3 331
  • 文/蒙蒙 一脖镀、第九天 我趴在偏房一處隱蔽的房頂上張望飒箭。 院中可真熱鬧,春花似錦蜒灰、人聲如沸弦蹂。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,003評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽凸椿。三九已至,卻和暖如春翅溺,著一層夾襖步出監(jiān)牢的瞬間脑漫,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,130評論 1 272
  • 我被黑心中介騙來泰國打工咙崎, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留优幸,地道東北人。 一個月前我還...
    沈念sama閱讀 48,348評論 3 373
  • 正文 我出身青樓褪猛,卻偏偏與公主長得像网杆,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 45,047評論 2 355

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開發(fā)人員提供了快速構建分布式系統(tǒng)中一些常見模式的工具(例如配置管理碳却,服務發(fā)現(xiàn)队秩,斷路器,智...
    卡卡羅2017閱讀 134,662評論 18 139
  • ·錯誤:1000 SQLSTATE: HY000 (ER_HASHCHK)消息:hashchk·錯誤:1001 S...
    Catke閱讀 1,626評論 0 2
  • 錯誤:1000 SQLSTATE: HY000 (ER_HASHCHK)消息:hashchk 錯誤:1001 SQ...
    灼灼2015閱讀 23,534評論 0 6
  • error code(錯誤代碼)=0是操作成功完成追城。error code(錯誤代碼)=1是功能錯誤刹碾。error c...
    Heikki_閱讀 3,385評論 1 9
  • 在iOS開發(fā)中經(jīng)常會遇到網(wǎng)絡請求的錯誤, 一方面可能會是自己網(wǎng)絡請求的方式, 參數(shù), 請求頭等造成的; 另一方面可...
    火之玉閱讀 11,655評論 0 12