mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-13 18:14:38 +02:00
Recover from broken config files, but keep a backup of the old one for purpose of data recovery.
This commit is contained in:
@@ -110,9 +110,10 @@ public class EssentialsConf extends Configuration
|
|||||||
super.load();
|
super.load();
|
||||||
}
|
}
|
||||||
catch (RuntimeException e)
|
catch (RuntimeException e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.SEVERE, "File broken: " + configFile.toString());
|
File broken = new File(configFile.getAbsolutePath() + ".broken." + System.currentTimeMillis());
|
||||||
throw e;
|
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)
|
if (this.root == null)
|
||||||
|
Reference in New Issue
Block a user