Skip to content

Commit

Permalink
Log spell name when an exception is thrown on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Malfrador committed Jan 21, 2025
1 parent c9a3145 commit 569ee8f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void loadSpells(File spellFolder) {
return;
}
ClassLoader classLoader = plugin.getClass().getClassLoader();
String currentPath = new File("").getAbsolutePath();
try {
for (File f : getFilesForFolder(new File(spellFolder, "spells"))) {
if (!f.getName().endsWith(".yml")) {
Expand Down Expand Up @@ -111,7 +112,7 @@ public void loadSpells(File spellFolder) {
spellbookAPI.getServer().getLogger().info("Loaded " + loadedTraits.size() + " traits.");

} catch (Exception e) {
spellbookAPI.getServer().getLogger().log(Level.SEVERE, "An error occurred while loading spells/effects/traits: " + e.getMessage());
spellbookAPI.getServer().getLogger().log(Level.SEVERE, "An error occurred while loading spells/effects/traits: " + currentPath + " Error: " + e.getMessage());
e.printStackTrace();
}
}
Expand Down

0 comments on commit 569ee8f

Please sign in to comment.