Class ErrorInterceptor

  • All Implemented Interfaces:
    okhttp3.Interceptor

    public class ErrorInterceptor
    extends java.lang.Object
    implements okhttp3.Interceptor
    This interceptor will only be used for throwing an exception, once the server returns an error.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface okhttp3.Interceptor

        okhttp3.Interceptor.Chain
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      okhttp3.Response intercept​(okhttp3.Interceptor.Chain chain)
      Intercepts chain to check for unsuccessful requests.
      • Methods inherited from class java.lang.Object

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

      • ErrorInterceptor

        public ErrorInterceptor()
    • Method Detail

      • intercept

        public okhttp3.Response intercept​(okhttp3.Interceptor.Chain chain)
                                   throws java.io.IOException
        Intercepts chain to check for unsuccessful requests.
        Specified by:
        intercept in interface okhttp3.Interceptor
        Parameters:
        chain - provided by the framework to check
        Returns:
        the response if no error occurred
        Throws:
        java.io.IOException - will get thrown if response code is unsuccessful