Check PAPI Debug before printing the error

This commit is contained in:
darbyjack committed 2023-02-28 12:28:39 -06:00
1 parent 2842d0d8f9
commit a832abeff3
1 file changed
+4 -2
@@ -114,8 +114,10 @@ public class ServerExpansion extends PlaceholderExpansion implements Cacheable,
try {
return String.valueOf(cache.get(key, callable));
} catch (ExecutionException e) {
getPlaceholderAPI().getLogger().log(Level.SEVERE, "[server] Could not access cache key " + key, e);
return "Error: " + e.getMessage() + " (see console)";
if (getPlaceholderAPI().getPlaceholderAPIConfig().isDebugMode()) {
getPlaceholderAPI().getLogger().log(Level.SEVERE, "[server] Could not access cache key " + key, e);
}
return "";
}
}