net.lenni0451.commandlib.exceptions.CommandExecutionException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CommandLib Show documentation
Show all versions of CommandLib Show documentation
A command lib with a simple and powerful API
The newest version!
package net.lenni0451.commandlib.exceptions;
import net.lenni0451.commandlib.ParseResult;
import javax.annotation.Nullable;
import java.util.List;
/**
* An exception which is thrown when an error occurs during the execution of a command.
* It contains a map of all chains which were tried to execute and the exception which was thrown while executing them.
* The chains are sorted by the most likely to be the correct one.
*/
public class CommandExecutionException extends Exception {
private final String command;
private final List> mostLikelyChains;
public CommandExecutionException(final String command) {
this(command, null);
}
public CommandExecutionException(final String command, @Nullable final List> mostLikelyChains) {
super("An error occurred whilst executing command: " + command + "");
this.command = command;
this.mostLikelyChains = mostLikelyChains;
}
/**
* @return The command which was executed
*/
public String getCommand() {
return this.command;
}
/**
* @return A map of all chains which were tried to execute
*/
@Nullable
public List> getMostLikelyChains() {
return this.mostLikelyChains;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy