import java.io.IOException;
import okhttp3.Interceptor;
import okhttp3.Response;
public class ResponseInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Response response = chain.proceed(chain.request());
int code = response.code();
if (code != 200) {
throw new ErrorException(code, response.body().string());
}
return response;
}
}