mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-27 08:59:45 +00: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
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue