Package 

Class EmbraceOkHttp3ApplicationInterceptor

  • All Implemented Interfaces:
    okhttp3.Interceptor

    
    public final class EmbraceOkHttp3ApplicationInterceptor
     implements Interceptor
                        

    This interceptor will only intercept errors that client app experiences.

    We used OkHttp application interceptor in this case because this interceptor will be added first in the OkHttp3 interceptors stack. This allows us to catch network errors. OkHttp network interceptors are added almost at the end of stack, they are closer to "the wire" so they are not able to see network errors.

    We used the EmbraceCustomPathException to capture the custom path added in the interceptor chain process for client errors on requests to a generic URL like a GraphQL endpoint.

    • Method Summary

      Modifier and Type Method Description
      Response intercept(Interceptor.Chain chain)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EmbraceOkHttp3ApplicationInterceptor

        EmbraceOkHttp3ApplicationInterceptor(Embrace embrace, EmbraceInternalApi embraceInternalApi)
    • Method Detail

      • intercept

         Response intercept(Interceptor.Chain chain)