FileConfigStore: Warn for deletion failure in exception path

There's nothing we can do about it at this point; we're already rolling
back changes.

Signed-off-by: Samuel Holland <samuel@sholland.org>
This commit is contained in:
Samuel Holland 2018-01-18 04:12:54 -06:00
parent 23535c0577
commit c683d23125

View File

@ -77,7 +77,8 @@ public final class FileConfigStore implements ConfigStore {
if (!replacementFile.createNewFile())
throw new IOException("Configuration for " + replacement + " already exists");
if (!file.renameTo(replacementFile)) {
replacementFile.delete();
if (!replacementFile.delete())
Log.w(TAG, "Couldn't delete marker file for new name " + replacement);
throw new IOException("Cannot rename configuration file " + file.getName());
}
}