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.List;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.addons.Addon;
|
import world.bentobox.bentobox.api.addons.Addon;
|
||||||
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
import world.bentobox.bentobox.database.AbstractDatabaseHandler;
|
||||||
@ -63,7 +65,8 @@ public class Config<T> {
|
|||||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
|
||||||
| ClassNotFoundException | IntrospectionException | NoSuchMethodException | SecurityException e) {
|
| ClassNotFoundException | IntrospectionException | NoSuchMethodException | SecurityException e) {
|
||||||
logger.severe(() -> "Could not load config object! " + e.getMessage());
|
logger.severe(() -> "Could not load config object! " + e.getMessage());
|
||||||
e.printStackTrace();
|
// Required for debugging
|
||||||
|
logger.severe(ExceptionUtils.getStackTrace(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -17,6 +17,7 @@ import java.util.jar.JarEntry;
|
|||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.InvalidConfigurationException;
|
import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
@ -177,11 +178,8 @@ public class AddonsManager {
|
|||||||
addon.setState(Addon.State.ERROR);
|
addon.setState(Addon.State.ERROR);
|
||||||
plugin.logError("Skipping " + addon.getDescription().getName() + " due to an unhandled exception...");
|
plugin.logError("Skipping " + addon.getDescription().getName() + " due to an unhandled exception...");
|
||||||
plugin.logError("STACKTRACE: " + throwable.getClass().getSimpleName() + " - " + throwable.getMessage() + " - " + throwable.getCause());
|
plugin.logError("STACKTRACE: " + throwable.getClass().getSimpleName() + " - " + throwable.getMessage() + " - " + throwable.getCause());
|
||||||
throwable.printStackTrace();
|
// Required for addon development
|
||||||
if (plugin.getConfig().getBoolean("debug")) {
|
plugin.logError(ExceptionUtils.getStackTrace(throwable));
|
||||||
plugin.logDebug(throwable.toString());
|
|
||||||
plugin.logDebug(throwable.getStackTrace());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user