Moved addon exception to exceptions package and deprecated old ones

This commit is contained in:
Florian CUNY 2018-11-19 09:02:39 +01:00
parent a5cb49553a
commit 49f9784b61
8 changed files with 71 additions and 3 deletions

View File

@ -17,8 +17,8 @@ import org.bukkit.plugin.InvalidDescriptionException;
import org.bukkit.util.permissions.DefaultPermissions;
import world.bentobox.bentobox.api.addons.AddonDescription.AddonDescriptionBuilder;
import world.bentobox.bentobox.api.addons.exception.InvalidAddonFormatException;
import world.bentobox.bentobox.api.addons.exception.InvalidAddonInheritException;
import world.bentobox.bentobox.api.addons.exceptions.InvalidAddonFormatException;
import world.bentobox.bentobox.api.addons.exceptions.InvalidAddonInheritException;
import world.bentobox.bentobox.managers.AddonsManager;
/**

View File

@ -1,5 +1,9 @@
package world.bentobox.bentobox.api.addons.exception;
/**
* @deprecated Moved to {@link world.bentobox.bentobox.api.addons.exceptions.AddonException}.
*/
@Deprecated
public abstract class AddonException extends Exception {
/**

View File

@ -4,6 +4,10 @@ import java.util.logging.Level;
import org.bukkit.Bukkit;
/**
* @deprecated Moved to {@link world.bentobox.bentobox.api.addons.exceptions.InvalidAddonFormatException}.
*/
@Deprecated
public class InvalidAddonFormatException extends AddonException {
/**

View File

@ -1,5 +1,9 @@
package world.bentobox.bentobox.api.addons.exception;
/**
* @deprecated Moved to {@link world.bentobox.bentobox.api.addons.exceptions.InvalidAddonInheritException}.
*/
@Deprecated
public class InvalidAddonInheritException extends AddonException {
/**

View File

@ -0,0 +1,14 @@
package world.bentobox.bentobox.api.addons.exceptions;
public abstract class AddonException extends Exception {
/**
*
*/
private static final long serialVersionUID = 4203162022348693854L;
public AddonException(String errorMessage){
super("AddonException : " + errorMessage);
}
}

View File

@ -0,0 +1,28 @@
package world.bentobox.bentobox.api.addons.exceptions;
import org.bukkit.Bukkit;
import java.util.logging.Level;
public class InvalidAddonFormatException extends AddonException {
/**
*
*/
private static final long serialVersionUID = 7741502900847049986L;
public InvalidAddonFormatException(String errorMessage) {
super(errorMessage);
}
@Override
public void printStackTrace(){
super.printStackTrace();
Bukkit.getLogger().log(Level.WARNING, " Basic format : (addon.yml)");
Bukkit.getLogger().log(Level.WARNING, " main: path.to.your.MainClass");
Bukkit.getLogger().log(Level.WARNING, " name: <NameOfYourModule>");
Bukkit.getLogger().log(Level.WARNING, " authors: <AuthorA> | <AuthorA, AuthorB>");
Bukkit.getLogger().log(Level.WARNING, " version: YourVersion");
}
}

View File

@ -0,0 +1,14 @@
package world.bentobox.bentobox.api.addons.exceptions;
public class InvalidAddonInheritException extends AddonException {
/**
*
*/
private static final long serialVersionUID = -5847358994397613244L;
public InvalidAddonInheritException(String errorMessage) {
super(errorMessage);
}
}

View File

@ -25,7 +25,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.api.addons.AddonClassLoader;
import world.bentobox.bentobox.api.addons.exception.InvalidAddonFormatException;
import world.bentobox.bentobox.api.addons.exceptions.InvalidAddonFormatException;
import world.bentobox.bentobox.api.events.addon.AddonEvent;
/**