Internet check, where to place when using MVP, RX and Retrofit
<p>I have went through <a href="https://stackoverflow.com/questions/37589008/android-internet-check-layer">this</a> and <a href="https://stackoverflow.com/questions/37007994/android-mvp-where-check-internet-connection#">this</a> post. So I really agree with the second post that presenter should not be aware of android specific thing. So what I am thinking is putting internet check in service layer.
I am using Rx Java for making network calls, so I can either place the network check before making a service call, so this way I need to manually throw and IOException because I need to show an error page on view when network is not available, the other option is I create my own error class for no internet</p>

<pre><code>Observable&lt;PaginationResponse&lt;Notification&gt;&gt; response = Observable.create(new Observable.OnSubscribe&lt;PaginationResponse&lt;Notification&gt;&gt;() {
            @Override
            public void call(Subscriber&lt;? super PaginationResponse&lt;Notification&gt;&gt; subscriber) {
                if (isNetworkConnected()) {
                    Call&lt;List&lt;Notification&gt;&gt; call = mService.getNotifications();
                    try {
                        Response&lt;List&lt;Notification&gt;&gt; response = call.execute();
                        processPaginationResponse(subscriber, response);
                    } catch (IOException e) {
                        e.printStackTrace();
                        subscriber.onError(e);
                    }
                } else {
//This is I am adding manually
                    subscriber.onError(new IOException);
                }
                subscriber.onCompleted();
            }
        });
</code></pre>

<p>The other way I though of is adding interceptor to OkHttpClient and set it to retrofit</p>

<pre><code>OkHttpClient.Builder builder = new OkHttpClient().newBuilder();
        builder.addInterceptor(new Interceptor() {
            @Override
            public Response intercept(Chain chain) throws IOException {
                if (!isNetworkConnected()) {
                    throw new IOException();
                }
                final Request.Builder builder = chain.request().newBuilder();

                Request request = builder.build();

                return chain.proceed(request);
            }
        });
</code></pre>

<p>Now the 2nd approach is more scalable, but I am not sure it will be efficient as I would be unnecessarily calling service method and call.execute() method.</p>

<p>Any suggestion which way should be used?
Also my parameter for judging the way is</p>

<ul>
<li><p>Efficiency</p></li>
<li><p>Scalability</p></li>
<li><p>Generic : I want this same logic can be used across apps who are following the similar architecture where MVP and Repository/DataProvider (May give data from network/db)</p></li>
</ul>

<p><strong>Other suggestions are also welcome, if you people are already using any other way.</strong></p>