From c683d23125359420725d9021ed29abda7380648d Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 18 Jan 2018 04:12:54 -0600 Subject: 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 --- .../main/java/com/wireguard/android/configStore/FileConfigStore.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com/wireguard/android') diff --git a/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java b/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java index f5cd01f0..ea5baf6d 100644 --- a/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java +++ b/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java @@ -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()); } } -- cgit v1.2.3