Closed showdy closed 4 years ago
D/OkHttp: --> POST https://api.github.com/authorizations D/OkHttp: Content-Type: application/json; charset=UTF-8 D/OkHttp: Content-Length: 172 D/OkHttp: Accept: application/json D/OkHttp: {"client_id":"","client_secret":"","note":"com.qingmei2.sample","scopes":["user","repo","gist","notifications"]} D/OkHttp: --> END POST (172-byte body) D/OkHttp: <-- HTTP FAILED: java.net.ConnectException: Failed to connect to api.github.com/13.250.168.23:443
网络环境问题,连接不上GitHub ? 毕竟现在特殊时期。
我之前协程的实现方式中对错误处理有点问题,这两天修改下
/com.qingmei2.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.qingmei2.sample, PID: 12087 java.net.ConnectException: Failed to connect to api.github.com/13.250.168.23:443 at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:268) at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:180) at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:238) at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:111) at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:79) at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.kt:163) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:35) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at com.qingmei2.sample.http.interceptor.BasicAuthInterceptor.intercept(BasicAuthInterceptor.kt:24) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:219) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:194) at okhttp3.RealCall$AsyncCall.run(RealCall.kt:138) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784) Caused by: java.net.ConnectException: failed to connect to api.github.com/13.250.168.23 (port 443) from /192.168.124.107 (port 50196) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused) at libcore.io.IoBridge.isConnected(IoBridge.java:278) at libcore.io.IoBridge.connectErrno(IoBridge.java:187) at libcore.io.IoBridge.connect(IoBridge.java:129) at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:391) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:231) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:213) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436) at java.net.Socket.connect(Socket.java:621) at okhttp3.internal.platform.AndroidPlatform.connectSocket(AndroidPlatform.kt:57) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:266) at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:180) at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:238) at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:111) at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:79) at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.kt:163) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:35) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at com.qingmei2.sample.http.interceptor.BasicAuthInterceptor.intercept(BasicAuthInterceptor.kt:24) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:219) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:194) at okhttp3.RealCall$AsyncCall.run(RealCall.kt:138) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784) Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused) at libcore.io.IoBridge.isConnected(IoBridge.java:267) at libcore.io.IoBridge.connectErrno(IoBridge.java:187) at libcore.io.IoBridge.connect(IoBridge.java:129) at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:137) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:391) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:231) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:213) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436) at java.net.Socket.connect(Socket.java:621) at okhttp3.internal.platform.AndroidPlatform.connectSocket(AndroidPlatform.kt:57) at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:266) at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:180) at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:238) at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:111) at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:79) at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.kt:163) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:35) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at com.qingmei2.sample.http.interceptor.BasicAuthInterceptor.intercept(BasicAuthInterceptor.kt:24) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:219) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87) at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:194) at okhttp3.RealCall$AsyncCall.run(RealCall.kt:138) at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:784)