@Nullable
  default <T extends ImportableItem, R extends Serializable> R importAndSwallowIOExceptions(
      T item, ImportFunction<T, R> function) throws Exception {
    return executeAndSwallowIOExceptions(
        item.getIdempotentId(),
        item.getName(),
        () -> {
          // apply can throw, it's ok
          ItemImportResult<R> r = function.apply(item);
          if (r.getStatus() == ItemImportResult.Status.SUCCESS) {
            return r.getData();
          } else {
            throw r.getException();
          }
        });
  }
Execute an import function for a given item. The function throws whatever exception was wrapped
in the returning Rusult. If you can, please wrap an exception rather than throw it because an
import executor implementation might have some use of the result meta-information.
portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/idempotentexecutor/IdempotentImportExecutor.java