Class ErrorInterceptor
- java.lang.Object
-
- com.contentful.java.cda.interceptor.ErrorInterceptor
-
- All Implemented Interfaces:
okhttp3.Interceptor
public class ErrorInterceptor extends java.lang.Object implements okhttp3.InterceptorThis interceptor will only be used for throwing an exception, once the server returns an error.
-
-
Constructor Summary
Constructors Constructor Description ErrorInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)Intercepts chain to check for unsuccessful requests.
-
-
-
Method Detail
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws java.io.IOExceptionIntercepts chain to check for unsuccessful requests.- Specified by:
interceptin interfaceokhttp3.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
-
-