Readded exceptions without context, useful for exceptions during execution

This commit is contained in:
Nathan Adams 2017-08-15 14:36:27 +02:00
parent 02f3a68ac0
commit f287b89ee4
2 changed files with 8 additions and 0 deletions

View file

@ -39,6 +39,10 @@ public class ParameterizedCommandExceptionType implements CommandExceptionType {
return result.toString();
}
public CommandException create(final Object... values) {
return new CommandException(this, createMap(values));
}
public CommandException createWithContext(final ImmutableStringReader reader, final Object... values) {
return new CommandException(this, createMap(values), reader.getString(), reader.getCursor());
}

View file

@ -25,6 +25,10 @@ public class SimpleCommandExceptionType implements CommandExceptionType {
return message;
}
public CommandException create() {
return new CommandException(this, ImmutableMap.of());
}
public CommandException createWithContext(final ImmutableStringReader reader) {
return new CommandException(this, ImmutableMap.of(), reader.getString(), reader.getCursor());
}