code: private static boolean isNetworkConnectException(Throwable e) {
          do {
              if (IOException.class.isInstance(e)) {
                  return true;
              }
              e = e.getCause();
          } while (e != null);
          return false;
      }
docs: Check if the exception is some sort of network timeout exception (ie)
  read,connect.
  
  @param e
  The exception for which the information needs to be found.
  @return true, if it is a network timeout, false otherwise.