You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously (~3.7.3) it was possible to handle the exceptions thrown from custom ApolloInterceptor, but now they were no longer caught and caused the app to crash.
It seems to be related to the order of APQ interceptor. From my research, reverting this PR on tag v.3.7.4 fixes this issue: #4628
Logs
E FATAL EXCEPTION: main
Process: sample.app, PID: 24746
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:558)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Caused by: sample.app.NoNetworkException
at sample.app.apollo.ApolloNetworkConnectivityInterceptor.intercept(ApolloNetworkConnectivityInterceptor.kt:22)
at com.apollographql.apollo3.interceptor.DefaultInterceptorChain.proceed(ApolloInterceptor.kt:23)
at sample.app.apollo.ApolloClientBuilder$apolloClient$1.intercept(ApolloClientBuilder.kt:83)
at com.apollographql.apollo3.interceptor.DefaultInterceptorChain.proceed(ApolloInterceptor.kt:23)
at com.apollographql.apollo3.ApolloClient.executeAsFlow(ApolloClient.kt:178)
at com.apollographql.apollo3.ApolloCall.toFlow(ApolloCall.kt:97)
The text was updated successfully, but these errors were encountered:
I am not entirely sure why throwing directly used to work in previous versions, but I do believe this way makes more sense.
Also, talking about exception handling, heads-up that we are planning changes in this area in the upcoming major version 4.0 - you can have a look at this issue to have more information.
Version
3.4.0~ (Confirmed it also occurs in 3.8.0)
Summary
Previously (~3.7.3) it was possible to handle the exceptions thrown from custom ApolloInterceptor, but now they were no longer caught and caused the app to crash.
Steps to reproduce the behavior
My Apollo Client
The interceptor: throws an exception on no connectivity
Previously, we can catch its exception:
but now the app crashes.
It seems to be related to the order of APQ interceptor. From my research, reverting this PR on tag v.3.7.4 fixes this issue: #4628
Logs
The text was updated successfully, but these errors were encountered: