code: public boolean ioError(Throwable throwable) {
      if (throwable instanceof IOException || throwable instanceof IOError) {
        return true;
      }
      return throwable.getCause() != null && ioError(throwable.getCause());
    }
docs: Determine if a given Throwable is caused by an IO error.
  Recursively checks getCause() if outer exception isn't an instance of the
  correct class.
  
  @param throwable The Throwable to check.
  @return True if the Throwable is a result of an IO error.