code: public static IOException extractException(String operation, String path,
        ExecutionException ee) {
      IOException ioe;
      Throwable cause = ee.getCause();
      if (cause instanceof AmazonClientException) {
        ioe = translateException(operation, path, (AmazonClientException) cause);
      } else if (cause instanceof IOException) {
        ioe = (IOException) cause;
      } else {
        ioe = new IOException(operation + " failed: " + cause, cause);
      }
      return ioe;
    }
docs: Extract an exception from a failed future, and convert to an IOE.
  
  @param operation operation which failed
  @param path path operated on (may be null)
  @param ee execution exception
  @return an IOE which can be thrown