Closed bpollock-vida closed 5 years ago
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(SourceFile:704)
I'm missing an onError I guess. This is my bad. These stack traces are hard to understand at times.
I have a similar problem with ApoloClient`
`/ W/System.err: com.apollographql.apollo.exception.ApolloNetworkException: Failed to execute http call
/ W/System.err: at com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor$1$1.onFailure(ApolloServerInterceptor.java:91)
/ W/System.err: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:161)
/ W/System.err: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
/ W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
/ W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
/ W/System.err: at java.lang.Thread.run(Thread.java:764)
/ W/System.err: Caused by: java.net.SocketTimeoutException: timeout
/ W/System.err: at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.java:616)
/ W/System.err: at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.java:624)
/ W/System.err: at okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:146)
/ W/System.err: at okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:127)
/ W/System.err: at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at kirill.carca.com.webtotem.repository.AppoloClientWrapper$getClient$1.intercept(AppoloClientWrapper.kt:34)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:213)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
/ W/System.err: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
/ W/System.err: ... 4 more
/ W/System.err: com.apollographql.apollo.exception.ApolloNetworkException: Failed to execute http call
/ W/System.err: at com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor$1$1.onFailure(ApolloServerInterceptor.java:91)
/ W/System.err: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:161)
/ W/System.err: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
/ W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
/ W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
/ W/System.err: at java.lang.Thread.run(Thread.java:764)
/ W/System.err: Caused by: java.net.SocketTimeoutException: timeout
/ W/System.err: at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.java:616)
/ W/System.err: at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.java:624)
/ W/System.err: at okhttp3.internal.http2.Http2Stream.takeResponseHeaders(Http2Stream.java:146)
/ W/System.err: at okhttp3.internal.http2.Http2Codec.readResponseHeaders(Http2Codec.java:127)
/ W/System.err: at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at kirill.carca.com.webtotem.repository.AppoloClientWrapper$getClient$1.intercept(AppoloClientWrapper.kt:34)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:213)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
/ W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
/ W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
/ W/System.err: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:147)
/ W/System.err: ... 4 more`
`val clientBuilder = OkHttpClient.Builder()
val loggingInterceptor = HttpLoggingInterceptor()
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY)
clientBuilder.addInterceptor(loggingInterceptor)
// increase timeout for slow services
clientBuilder
.connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
clientBuilder.addInterceptor { chain ->
val request = chain.request().newBuilder().addHeader("Authorization",
"Bearer " + token!!).build()
chain.proceed(request)
}
return ApolloClient.builder()
.serverUrl(BASE_URL)
.okHttpClient(clientBuilder.build())
.clientBuilder.build()))
.build()`
Have to remove
override fun onNetworkError(e: ApolloNetworkException) {
super.onNetworkError(e)
}
In Callback
I closed this issue because it was programmer error (for me) you might want to file a new one.
Have to remove
override fun onNetworkError(e: ApolloNetworkException) { super.onNetworkError(e) }
In Callback
Is this solution working ? @kris1837 @bpollock-vida
I would expect these to come down through onError in Apollo-rx2.
Various connection timeouts and host issues can throw an exception when I’m executing Apollo queries/mutations with “Failed to execute http call”. Shouldn’t these come through as errors instead of exceptions?
Exception types:
Apollo Crashes:
Caused by com.a.a.c.d: Failed to execute http call at com.apollographql.apollo.internal.interceptor.ApolloServerInterceptor$1$1.onFailure(SourceFile:89) at okhttp3.RealCall$AsyncCall.execute(SourceFile:148) at okhttp3.internal.NamedRunnable.run(SourceFile:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)