void (@NotNull Task<?, ?> task, @NotNull Throwable throwable, int attempt) { if (throwable instanceof ProcessCanceledException || throwable instanceof IndexNotReadyException) { offerRestart(task, attempt); return; } try { LOG.error(throwable); } finally { task.promise.setError(throwable); } }