title: android webview catch bad url
body: <p>In my app I have receive URLs as string from a web-service and load it to a WebView.<br/></p>
  
  <pre><code>mainContentText = (WebView) findViewById(R.id.mainContentText); 
  mainContentText.getSettings().setJavaScriptEnabled(true);
  mainContentText.setWebViewClient(new CustomWebClient());
  
  mainContentText.loadUrl(url);
  
  private class CustomWebClient extends WebViewClient{
  
          private static final String TAG = "WebWiewActivity";
  
          @Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              Log.d(TAG, "loading: " + url);
              return false;
          }
  
          @Override
          public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
              super.onReceivedError(view, errorCode, description, failingUrl);
              Log.e(TAG, String.format("*ERROR*  Code: %d  Desc: %s  URL: %s", errorCode, description, failingUrl));
          }
      }
  </code></pre>
  
  <p>When tested a situation when the URL is not good (a random string, <code>url = "abc"</code>) I just receive a default error page, but nothing at <code>onReceivedError</code> and not <code>shouldOverrideUrlLoading</code> callbacks and no exceptions<br/>
  How can I catch such situation?</p>