public static boolean isNetworkException(Throwable e) {
    return e instanceof SocketException || e instanceof ClosedChannelException ||
        e instanceof InterruptedIOException || e instanceof ProtocolException ||
        e instanceof SSLException || e instanceof UnknownHostException ||
        e instanceof UnknownServiceException;
  }
From http://vaibhavblogs.org/2012/12/common-java-networking-exceptions/
lottie/src/main/java/com/airbnb/lottie/utils/Utils.java