title: How should I handle "No internet connection" with Retrofit on Android
body: <p>I'd like to handle situations when there is no internet connection. Usually I'd run:</p>
  
  <pre><code>ConnectivityManager cm =
      (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
  
  NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
  boolean isConnected = activeNetwork != null &amp;&amp;
                    activeNetwork.isConnectedOrConnecting();
  </code></pre>
  
  <p>(from <a href="http://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html" rel="noreferrer">here</a>) before sending the requests to the network and notify user if there were no internet connection.</p>
  
  <p>From what I saw Retrofit does not handle this situation specifically. If there is no internet connection I'll just get <code>RetrofitError</code> with timeout as a reason. </p>
  
  <p>If I'd like to incorporate this kind of check into every HTTP request with Retrofit, how should I do it? Or should I do it at all.</p>
  
  <p>Thanks</p>
  
  <p>Alex</p>