Skip to content
Permalink
Browse files

Make InvalidCommandArgument a runtime exception

  • Loading branch information...
MrIvanPlays committed Apr 3, 2019
1 parent 8a71578 commit 280e2f0da31728a54bc9376e416f699eec7111e1
Showing with 7 additions and 2 deletions.
  1. +7 −2 core/src/main/java/co/aikar/commands/InvalidCommandArgument.java
@@ -26,26 +26,31 @@
import co.aikar.locales.MessageKey;
import co.aikar.locales.MessageKeyProvider;

public class InvalidCommandArgument extends Exception {
public class InvalidCommandArgument extends RuntimeException {
final boolean showSyntax;
final MessageKey key;
final String[] replacements;

public InvalidCommandArgument() {
this(null, true);
}

public InvalidCommandArgument(boolean showSyntax) {
this(null, showSyntax);
}

public InvalidCommandArgument(MessageKeyProvider key, String... replacements) {
this(key.getMessageKey(), replacements);
}

public InvalidCommandArgument(MessageKey key, String... replacements) {
this(key, true, replacements);
}

public InvalidCommandArgument(MessageKeyProvider key, boolean showSyntax, String... replacements) {
this(key.getMessageKey(), showSyntax, replacements);
}

public InvalidCommandArgument(MessageKey key, boolean showSyntax, String... replacements) {
super(key.getKey(), null, false, false);
this.showSyntax = showSyntax;
@@ -54,7 +59,7 @@ public InvalidCommandArgument(MessageKey key, boolean showSyntax, String... repl
}

public InvalidCommandArgument(String message) {
this(message, true);
this(message, true);
}

public InvalidCommandArgument(String message, boolean showSyntax) {

0 comments on commit 280e2f0

Please sign in to comment.
You can’t perform that action at this time.