From 8baff42ff1cecf2c87f356d495662d7e150a3810 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') 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