mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-01 00:10:32 +01:00
Log filenames during configuration serialization errors (#4959)
This commit is contained in:
parent
8d856dd6db
commit
ff80338350
@ -85,14 +85,14 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
|||||||
try {
|
try {
|
||||||
holder = config.getRootNode().get(UserConfigHolder.class);
|
holder = config.getRootNode().get(UserConfigHolder.class);
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
ess.getLogger().log(Level.SEVERE, "Error while reading user config: " + e.getMessage(), e);
|
ess.getLogger().log(Level.SEVERE, "Error while reading user config: " + config.getFile().getName(), e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
config.setSaveHook(() -> {
|
config.setSaveHook(() -> {
|
||||||
try {
|
try {
|
||||||
config.getRootNode().set(UserConfigHolder.class, holder);
|
config.getRootNode().set(UserConfigHolder.class, holder);
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
ess.getLogger().log(Level.SEVERE, "Error while saving user config: " + e.getMessage(), e);
|
ess.getLogger().log(Level.SEVERE, "Error while saving user config: " + config.getFile().getName(), e);
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user