mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-24 03:35:11 +01:00
Shifted exception logging to logger.
These are really needed if you are writing an addon otherwise you are blind to any reasons for an error.
This commit is contained in:
parent
da21aa8c00
commit
2599839fad
@ -6,7 +6,9 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
|
||||
import world.bentobox.bentobox.BentoBox;
|
||||
import world.bentobox.bentobox.api.addons.Addon;
|
||||
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
||||
@ -63,7 +65,8 @@ public class Config<T> {
|
||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
||||
| ClassNotFoundException | IntrospectionException | NoSuchMethodException | SecurityException e) {
|
||||
logger.severe(() -> "Could not load config object! " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
// Required for debugging
|
||||
logger.severe(ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -17,6 +17,7 @@ import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
@ -177,11 +178,8 @@ public class AddonsManager {
|
||||
addon.setState(Addon.State.ERROR);
|
||||
plugin.logError("Skipping " + addon.getDescription().getName() + " due to an unhandled exception...");
|
||||
plugin.logError("STACKTRACE: " + throwable.getClass().getSimpleName() + " - " + throwable.getMessage() + " - " + throwable.getCause());
|
||||
throwable.printStackTrace();
|
||||
if (plugin.getConfig().getBoolean("debug")) {
|
||||
plugin.logDebug(throwable.toString());
|
||||
plugin.logDebug(throwable.getStackTrace());
|
||||
}
|
||||
// Required for addon development
|
||||
plugin.logError(ExceptionUtils.getStackTrace(throwable));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user