Search in sources :

Example 1 with UnexpectedCommandSetupException

use of net.robinfriedli.aiode.exceptions.UnexpectedCommandSetupException in project aiode by robinfriedli.

the class CommandParserInterceptor method performChained.

@Override
public void performChained(Command command) {
    if (command instanceof AbstractCommand) {
        AbstractCommand textBasedCommand = (AbstractCommand) command;
        CommandParser commandParser = new CommandParser(textBasedCommand, ArgumentPrefixProperty.getForCurrentContext());
        try {
            commandParser.parse();
        } catch (CommandParseException e) {
            throw e;
        } catch (Exception e) {
            throw new UnexpectedCommandSetupException(e);
        }
    }
}
Also used : CommandParseException(net.robinfriedli.aiode.exceptions.CommandParseException) AbstractCommand(net.robinfriedli.aiode.command.AbstractCommand) UnexpectedCommandSetupException(net.robinfriedli.aiode.exceptions.UnexpectedCommandSetupException) CommandParseException(net.robinfriedli.aiode.exceptions.CommandParseException) UnexpectedCommandSetupException(net.robinfriedli.aiode.exceptions.UnexpectedCommandSetupException) CommandParser(net.robinfriedli.aiode.command.parser.CommandParser)

Aggregations

AbstractCommand (net.robinfriedli.aiode.command.AbstractCommand)1 CommandParser (net.robinfriedli.aiode.command.parser.CommandParser)1 CommandParseException (net.robinfriedli.aiode.exceptions.CommandParseException)1 UnexpectedCommandSetupException (net.robinfriedli.aiode.exceptions.UnexpectedCommandSetupException)1