Skip to content

Commit f7b7f1d

Browse files
committed
Improve error message of global profile load/save
1 parent 50545ee commit f7b7f1d

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/main/java/org/mvplugins/multiverse/inventories/profile/GlobalProfile.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.mvplugins.multiverse.inventories.profile;
22

3+
import com.dumptruckman.minecraft.util.Logging;
34
import org.bukkit.OfflinePlayer;
45
import org.bukkit.configuration.ConfigurationSection;
56
import org.mvplugins.multiverse.core.config.handle.StringPropertyHandle;
@@ -31,15 +32,19 @@ public final class GlobalProfile {
3132
this.nodes = new Nodes();
3233
this.handle = JsonConfigurationHandle.builder(configPath, nodes.nodes).build();
3334
this.stringPropertyHandle = new StringPropertyHandle(handle);
34-
this.handle.load();
35+
load();
3536
}
3637

3738
Try<Void> load() {
38-
return handle.load();
39+
return handle.load().onFailure(e -> {
40+
Logging.severe("Failed to load global profile for player %s: %s", uuid, e.getMessage());
41+
});
3942
}
4043

4144
Try<Void> save() {
42-
return handle.save();
45+
return handle.save().onFailure(e -> {
46+
Logging.severe("Failed to save global profile for player %s: %s", uuid, e.getMessage());
47+
});
4348
}
4449

4550
public StringPropertyHandle getStringPropertyHandle() {

0 commit comments

Comments
 (0)