Catch both FileNotFound & NoSuchFileException

This commit is contained in:
Simon Willnauer 2014-10-25 09:34:18 +02:00
parent 62d8b7ab97
commit c95545a64e
1 changed files with 2 additions and 2 deletions

View File

@ -34,6 +34,7 @@ import org.elasticsearch.index.shard.service.InternalIndexShard;
import org.elasticsearch.index.store.Store;
import org.elasticsearch.index.store.StoreFileMetaData;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.NoSuchFileException;
import java.util.Iterator;
@ -154,8 +155,7 @@ public class RecoveryStatus extends AbstractRefCounted {
// first, go and delete the existing ones
try {
directory.deleteFile(origFile);
} catch (NoSuchFileException e) {
} catch (FileNotFoundException | NoSuchFileException e) {
} catch (Throwable ex) {
logger.debug("failed to delete file [{}]", ex, origFile);
}