class ApiErrorExtractor {

  public boolean ioError(Throwable throwable) {
    if (throwable instanceof IOException || throwable instanceof IOError) {
      return true;
    }
    Throwable cause = throwable.getCause();
    return cause != null && ioError(cause);
  }

}