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:
parent
23535c0577
commit
c683d23125
@ -77,7 +77,8 @@ public final class FileConfigStore implements ConfigStore {
|
|||||||
if (!replacementFile.createNewFile())
|
if (!replacementFile.createNewFile())
|
||||||
throw new IOException("Configuration for " + replacement + " already exists");
|
throw new IOException("Configuration for " + replacement + " already exists");
|
||||||
if (!file.renameTo(replacementFile)) {
|
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());
|
throw new IOException("Cannot rename configuration file " + file.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user