[platform] collects exceptions (EA-88092)

This commit is contained in:
Roman Shevchenko
2016-09-23 21:09:09 +03:00
parent ee6da28a0d
commit 8f72193f1b
@@ -20,6 +20,8 @@ import com.intellij.ide.DeleteProvider;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.ApplicationBundle;
import com.intellij.openapi.application.Result;
import com.intellij.openapi.application.RunResult;
import com.intellij.openapi.application.WriteAction;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.diagnostic.Logger;
@@ -33,7 +35,6 @@ import com.intellij.ui.UIBundle;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
@@ -71,11 +72,15 @@ public final class VirtualFileDeleteProvider implements DeleteProvider {
indicator.setFraction((double)i / files.length);
i++;
try {
WriteAction.run(() -> file.delete(this));
}
catch (IOException e) {
LOG.info("Error when deleting " + file, e);
RunResult result = new WriteAction() {
@Override
protected void run(@NotNull Result result) throws Throwable {
file.delete(this);
}
}.executeSilently();
if (result.hasException()) {
LOG.info("Error when deleting " + file, result.getThrowable());
problems.add(file.getName());
}
}