summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-02-02 09:48:56 +0000
committerKHobbits <rob@khobbits.co.uk>2012-02-02 09:48:56 +0000
commite3f3fe84ea9a2e665105f0acc334dbd0fd1c9f8e (patch)
tree1482f3e9686295b3b02ced539840aed90ea7d29c
parent6e2ac3b56ec504b60c104b4a5856843e34b3eb23 (diff)
downloadEssentials-e3f3fe84ea9a2e665105f0acc334dbd0fd1c9f8e.tar
Essentials-e3f3fe84ea9a2e665105f0acc334dbd0fd1c9f8e.tar.gz
Essentials-e3f3fe84ea9a2e665105f0acc334dbd0fd1c9f8e.tar.lz
Essentials-e3f3fe84ea9a2e665105f0acc334dbd0fd1c9f8e.tar.xz
Essentials-e3f3fe84ea9a2e665105f0acc334dbd0fd1c9f8e.zip
Recover from broken config files, but keep a backup of the old one for purpose of data recovery.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsConf.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java
index 35252532f..ec6e27b53 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java
@@ -110,9 +110,10 @@ public class EssentialsConf extends Configuration
super.load();
}
catch (RuntimeException e)
- {
- LOGGER.log(Level.SEVERE, "File broken: " + configFile.toString());
- throw e;
+ {
+ File broken = new File(configFile.getAbsolutePath() + ".broken." + System.currentTimeMillis());
+ configFile.renameTo(broken);
+ LOGGER.log(Level.SEVERE, "The file " + configFile.toString() + " is broken, it has been renamed to " + broken.toString(), e.getCause());
}
if (this.root == null)