1. 程式人生 > >56.網路請求及各類錯誤程式碼含義總結(Errors Code)

56.網路請求及各類錯誤程式碼含義總結(Errors Code)

在很多時候都會遇到錯誤, 還會帶有一些 Error Code , 比如在各種網路請求, 檔案操作, cookie 錯誤等各種錯誤的程式碼和錯誤程式碼對應的含義. 以下目錄為 SOCKS4 Errors, SOCKS5 Errors, FTP Errors, HTTP Errors, CFURLConnection & CFURLProtocol Errors, File Errors, SSL Errors, Download and File I/O Errors, Cookie errors, CFNetServices Errors等各種型別錯誤程式碼。

一般使用 AFN中將 error 打印出來, 根據CFURLConnection & CFURLProtocol的 Errors code和  HTTP  status code.比如:Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" ,-1011為 error code, 500為 status code.

Code

Description

-1

NSURLErrorUnknown

1

kCFHostErrorHostNotFound

“Indicates that the DNS lookup failed.”

2

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

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

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 Errors

110

kCFSOCKS4ErrorRequestFailed

“Request rejected or failed by the server.”

111

kCFSOCKS4ErrorIdentdFailed

“Request rejected because SOCKS server cannot connect to identd on the client.”

112

kCFSOCKS4ErrorIdConflict

“Request rejected because the client program and identd report different user-ids.”

113

kCFSOCKS4ErrorUnknownStatusCode

“The status code returned by the server is unknown.”

SOCKS5 Errors

120

kCFSOCKS5ErrorBadState

“The stream is not in a state that allows the requested operation.”

121

kCFSOCKS5ErrorBadResponseAddr

“The address type returned is not supported.”

122

kCFSOCKS5ErrorBadCredentials

“The SOCKS server refused the client connection because of bad login credentials.”

123

kCFSOCKS5ErrorUnsupportedNegotiationMethod

“The requested method is not supported. Query kCFSOCKSNegotiationMethodKey to find the method requested.”

124

kCFSOCKS5ErrorNoAcceptableMethod

“The client and server could not find a mutually agreeable authentication method.”

FTP Errors

200

kCFFTPErrorUnexpectedStatusCode

“The server returned an unexpected status code. Query the kCFFTPStatusCodeKey to get the status code returned by the server”

HTTP Errors

300

kCFErrorHTTPAuthenticationTypeUnsupported

“The client and server could not agree on a supported authentication type.”

301

kCFErrorHTTPBadCredentials

“The credentials provided for an authenticated connection were rejected by the server.”

302

kCFErrorHTTPConnectionLost

“The connection to the server was dropped. This usually indicates a highly overloaded server.”

303

kCFErrorHTTPParseFailure

“The HTTP server response could not be parsed.”

304

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

kCFErrorHTTPBadURL

“The requested URL could not be retrieved.”

306

kCFErrorHTTPProxyConnectionFailure

“A connection could not be established to the HTTP proxy.”

307

kCFErrorHTTPBadProxyCredentials

“The authentication credentials provided for logging into the proxy were rejected.”

308

kCFErrorPACFileError

“An error occurred with the proxy autoconfiguration file.”

309

kCFErrorPACFileAuth

“The authentication credentials provided by the proxy autoconfiguration file were rejected.”

310

kCFErrorHTTPSProxyConnectionFailure

“A connection could not be established to the HTTPS proxy.”

311

kCFStreamErrorHTTPSProxyFailureUnexpectedResponseToCONNECTMethod

“The HTTPS proxy returned an unexpected status code, such as a 3xx redirect.”

CFURLConnection & CFURLProtocol Errors

-998

kCFURLErrorUnknown

“An unknown error occurred.”

-999

kCFURLErrorCancelled

NSURLErrorCancelled

“The connection was cancelled.”

-1000

kCFURLErrorBadURL

NSURLErrorBadURL

“The connection failed due to a malformed URL.”

-1001

kCFURLErrorTimedOut

NSURLErrorTimedOut

“The connection timed out.”

-1002

kCFURLErrorUnsupportedURL

NSURLErrorUnsupportedURL

“The connection failed due to an unsupported URL scheme.”

-1003

kCFURLErrorCannotFindHost

NSURLErrorCannotFindHost

“The connection failed because the host could not be found.”

-1004

kCFURLErrorCannotConnectToHost

NSURLErrorCannotConnectToHost

“The connection failed because a connection cannot be made to the host.”

-1005

kCFURLErrorNetworkConnectionLost

NSURLErrorNetworkConnectionLost

“The connection failed because the network connection was lost.”

-1006

kCFURLErrorDNSLookupFailed

NSURLErrorDNSLookupFailed

“The connection failed because the DNS lookup failed.”

-1007

kCFURLErrorHTTPTooManyRedirects

NSURLErrorHTTPTooManyRedirects

“The HTTP connection failed due to too many redirects.”

-1008

kCFURLErrorResourceUnavailable

NSURLErrorResourceUnavailable

“The connection’s resource is unavailable.”

-1009

kCFURLErrorNotConnectedToInternet

NSURLErrorNotConnectedToInternet

“The connection failed because the device is not connected to the internet.”

-1010

kCFURLErrorRedirectToNonExistentLocation

NSURLErrorRedirectToNonExistentLocation

“The connection was redirected to a nonexistent location.”

-1011

kCFURLErrorBadServerResponse

NSURLErrorBadServerResponse

“The connection received an invalid server response.”

-1012

kCFURLErrorUserCancelledAuthentication

NSURLErrorUserCancelledAuthentication

“The connection failed because the user cancelled required authentication.”

-1013

kCFURLErrorUserAuthenticationRequired

NSURLErrorUserAuthenticationRequired

“The connection failed because authentication is required.”

-1014

kCFURLErrorZeroByteResource

NSURLErrorZeroByteResource

“The resource retrieved by the connection is zero bytes.”

-1015

kCFURLErrorCannotDecodeRawData

NSURLErrorCannotDecodeRawData

“The connection cannot decode data encoded with a known content encoding.”

-1016

kCFURLErrorCannotDecodeContentData

NSURLErrorCannotDecodeContentData

“The connection cannot decode data encoded with an unknown content encoding.”

-1017

kCFURLErrorCannotParseResponse

NSURLErrorCannotParseResponse

“The connection cannot parse the server’s response.”

-1018

kCFURLErrorInternationalRoamingOff

“The connection failed because international roaming is disabled on the device.”

-1019

kCFURLErrorCallIsActive

“The connection failed because a call is active.”

-1020

kCFURLErrorDataNotAllowed

“The connection failed because data use is currently not allowed on the device.”

-1021

kCFURLErrorRequestBodyStreamExhausted

“The connection failed because its request’s body stream was exhausted.”

File Errors

-1100

kCFURLErrorFileDoesNotExist

NSURLErrorFileDoesNotExist

“The file operation failed because the file does not exist.”

-1101

kCFURLErrorFileIsDirectory

NSURLErrorFileIsDirectory

“The file operation failed because the file is a directory.”

-1102

kCFURLErrorNoPermissionsToReadFile

NSURLErrorNoPermissionsToReadFile

“The file operation failed because it does not have permission to read the file.”

-1103

kCFURLErrorDataLengthExceedsMaximum

NSURLErrorDataLengthExceedsMaximum

“The file operation failed because the file is too large.”

SSL Errors

-1200

kCFURLErrorSecureConnectionFailed

NSURLErrorSecureConnectionFailed

“The secure connection failed for an unknown reason.”

-1201

kCFURLErrorServerCertificateHasBadDate

NSURLErrorServerCertificateHasBadDate

“The secure connection failed because the server’s certificate has an invalid date.”

-1202

kCFURLErrorServerCertificateUntrusted

NSURLErrorServerCertificateUntrusted

“The secure connection failed because the server’s certificate is not trusted.”

-1203

kCFURLErrorServerCertificateHasUnknownRoot

NSURLErrorServerCertificateHasUnknownRoot

“The secure connection failed because the server’s certificate has an unknown root.”

-1204

kCFURLErrorServerCertificateNotYetValid

NSURLErrorServerCertificateNotYetValid

“The secure connection failed because the server’s certificate is not yet valid.”

-1205

kCFURLErrorClientCertificateRejected

NSURLErrorClientCertificateRejected

“The secure connection failed because the client’s certificate was rejected.”

-1206

kCFURLErrorClientCertificateRequired

NSURLErrorClientCertificateRequired

“The secure connection failed because the server requires a client certificate.”

Download and File I/O Errors

-2000

kCFURLErrorCannotLoadFromNetwork

NSURLErrorCannotLoadFromNetwork

“The connection failed because it is being required to return a cached resource, but one is not available.”

-3000

kCFURLErrorCannotCreateFile

NSURLErrorCannotCreateFile

“The file cannot be created.”

-3001

kCFURLErrorCannotOpenFile

NSURLErrorCannotOpenFile

“The file cannot be opened.”

-3002

kCFURLErrorCannotCloseFile

NSURLErrorCannotCloseFile

“The file cannot be closed.”

-3003

kCFURLErrorCannotWriteToFile

NSURLErrorCannotWriteToFile

“The file cannot be written.”

-3004

kCFURLErrorCannotRemoveFile

NSURLErrorCannotRemoveFile

“The file cannot be removed.”

-3005

kCFURLErrorCannotMoveFile

NSURLErrorCannotMoveFile

“The file cannot be moved.”

-3006

kCFURLErrorDownloadDecodingFailedMidStream

NSURLErrorDownloadDecodingFailedMidStream

“The download failed because decoding of the downloaded data failed mid-stream.”

-3007

kCFURLErrorDownloadDecodingFailedToComplete

NSURLErrorDownloadDecodingFailedToComplete

“The download failed because decoding of the downloaded data failed to complete.”

Cookie errors

-4000

kCFHTTPCookieCannotParseCookieFile

“The cookie file cannot be parsed.”

CFNetServices Errors

相關推薦

56.網路請求各類錯誤程式碼含義總結(Errors Code)

在很多時候都會遇到錯誤, 還會帶有一些 Error Code , 比如在各種網路請求, 檔案操作, cookie 錯誤等各種錯誤的程式碼和錯誤程式碼對應的含義. 以下目錄為 SOCKS4 Err

網路請求各類錯誤程式碼含義總結(包含AFN錯誤碼大全)

轉 http://blog.csdn.net/wangyanchang21/article/details/50932191 在很多時候都會遇到錯誤, 還會帶有一些 Error Code , 比如在各種網路請求, 檔案操作, cookie 錯誤等各種錯誤的

Web呼叫網路攝像頭各類錯誤處理

最近由於業務的原因,需要在Web端頁面接入除錯各類的網路攝像頭,遇到了很多匪夷所思的問題(說的就是讀得出攝像頭的品牌,讀不出攝像頭的解析度)。於是整理了這篇文章作為備忘錄,也希望能幫到有類似的小夥伴們。 ### 基礎程式碼 ```javascript navigator.mediaDevices.getU

【封裝】使用okHttp傳送網路請求上傳下載進度監聽

參考資料: 如何正確地寫出單例模式 http://wuchong.me/blog/2014/08/28/how-to-correctly-write-singleton-pattern 設計模式總結篇系列:單例模式(SingleTon) htt

Kotlin簡單網路請求資料解析

一,網路請求 以下是在Android下用最基礎的進行網路請求方法,但獲取的資料量大的話就不能用這個方法了 1,定義網路連線地址         val  url  =   " ",因為地址不需要改變,所以可以設定為常量,如果需要變的話請用 var 定義變數 2,Kotlin

常見Windows錯誤程式碼含義

MS Windows Error Messages   Code Error Message   0  操作成功完成。     1  功能錯誤。     2  系統找不到指定的檔案。     3  系統找不到指定的路徑。     4  系統無法開啟檔案。   

Android 網路請求網路狀態判斷

文章轉載: 網址:http://blog.csdn.net/anye_anye/article/details/50569114 Android 中判斷網路連線是否可用 一、判斷網路連線是否可用 public static boolean isNetworkAv

呼叫GetLastError 錯誤程式碼 含義

2005 msdn url: ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.WINCE.v50.en/wcecoreos5/html/wce50lrfsystemerrorsnumericalorder.htm The follow

Android 網路請求框架 Retrofit2.0實踐使用總結

比較AsyncHttpClient 、Volley、Retrofit三者的請求時間 使用 單次請求 7個請求 25個請求 AsyncHttpClient 941ms 4539ms 13957ms Volley

Oracle錯誤程式碼案例總結

常見錯誤: ORA-00001:違反唯一約束條件(主鍵錯誤) ORA-00028:無法連線資料庫程序 ORA-00900:無效sql語句 ORA-00904:欄位名寫錯或是建表時最後一個欄位有逗號 ORA-00907:缺少右括號 ORA-00911:無效字元 ORA-00917:缺少逗號 ORA-00918

Retrofit2.0 請求資料 一直出返回網路錯誤錯誤程式碼 414

今天 使用rettorfit 去請求資料一直不成功,請求邏輯上以及請求引數上都沒有問題,後臺也驗證過是通的(我用xutils3請求也是成功的,後來意識到xutils3是將引數放在請求體裡面),但是就是一直不能請求成功,後來終於發現還是引數的問題。 由於使用的是retrofit POST 請求,

retrofit第一次的網路請求eofException錯誤原因解決

<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">retrofit請求使用:</span> http://ww

Swagger2 在spring boot中的運用- API Docs在spring boot中詳細配置生成各個平臺介面網路請求程式碼生成Swagger-codegen-cli運用

好久沒有寫學習部落格了。在最近的工作中,學習到了一些比較好的工具。可以提高前後臺工作人員,測試人員的工作效率。甚至可以給產品提供相關直觀的參考。也利於版本迭代api的系統管理,現部落格記錄下來,有什麼不足之處請各位大牛指正!有很多因素促成了Swagger在構建RESTful

常見http錯誤程式碼含義!!

總結了一下http常見的錯誤程式碼: 1、400  --   無法解析此請求。 2、403  --   禁止訪問:訪問被拒絕。 3、404  --   找不到檔案或目錄。 4、405  --   用於訪問該頁的HTTP動作未被許可。 5、410  --   檔案已刪除。 6

VPN無法連線,VPN連線錯誤程式碼解決方案

  VPN無法連線是大家經常遇到的問題.連線不上VPN一般都會提示一些錯誤程式碼.其實我們可以通過這些錯誤程式碼來解決一些簡單的問題.   本篇文章會給大家簡單的介紹幾個常見的VPN錯誤程式碼以及對應的解決方案.這裡錯誤程式碼解決方案會時時更新.   807錯誤–無法連線到伺服器.請檢查你連

學習Android過程中遇到的問題解決方法——網路請求

在學習Android的網路連線時遇到崩潰或IOException異常(出現的問題就這兩個,但是不穩定)的問題,先上程式碼,看看哪裡錯了(答案在文末) activity_main.xml: 1 <?xml version="1.0" encoding="utf-8"?> 2 <

【轉載】筆記:無os的LwIP在TCP server歷程中網路資料傳送,串口出現tcp_writetcp_receive錯誤

  2016年09月07日 22:13:58 新野-新野 閱讀數:6180 標籤: LWIP 更多 個人分類: 轉載筆記 做一個,串列埠收到資料然後通過tcp主動傳送出去的東西,但是目前遇到以下問題,當tcp初始化後連

華為ENSP中AR啟動失敗錯誤程式碼40,42,43,啟動後一直#的問題的一種解決方案

系統是64位win10安裝ensp510時不斷40.42.43的錯且在不報錯時開啟ar時一直輸出#  查閱網上各種方法 一 一嘗試後發現, 我的問題是虛擬機器不是最新版本,且虛擬機器中沒有配置網絡卡,檢視是否有網絡卡配置,在virtualbox中點選左上角的管理,選擇全域性設定,然後在

【深度學習】Alexnet網路分析程式碼實現

簡介 Alexnet是2012年ImageNet比賽的冠軍Hinton及其學生Alex Krizhevsky提出,並以其姓名命名的網路。Alexnet的提出也正式掀起了深度學習的熱潮,激發了研究者對深度學習的熱情。雖然後面出現了更為優秀的VGGNet、GooLeNet、Re

利用Git 上傳程式碼到Coding的簡單操作步驟一些錯誤總結

今天看到git可以上傳程式碼到coding.net,感覺還是不錯的,於是自己動手上傳了一次,在期間發現了很多的問題,在這裡總結一下,希望能幫到未上傳成功的程式設計師們! 1:先自己註冊coding.net賬號! 2.安裝git 客戶端 安裝過程中的詳細說明可參考: https://jingyan.baidu