mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 01:27:40 +01:00
Recover from broken config files, but keep a backup of the old one for purpose of data recovery.
This commit is contained in:
parent
6e2ac3b56e
commit
e3f3fe84ea
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user