Improve CommandFramework Exception readability
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
a9a8a83c46
Commit
c0d3edd4b0
@ -32,6 +32,7 @@ public class CommandFrameworkException extends RuntimeException {
|
|||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
CommandFrameworkException(InvocationTargetException invocationTargetException, String alias, String[] args) {
|
CommandFrameworkException(InvocationTargetException invocationTargetException, String alias, String[] args) {
|
||||||
|
super(invocationTargetException);
|
||||||
this.invocationTargetException = invocationTargetException;
|
this.invocationTargetException = invocationTargetException;
|
||||||
this.alias = alias;
|
this.alias = alias;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
|
@ -102,7 +102,9 @@ public abstract class SWCommand {
|
|||||||
} catch (CommandNoHelpException e) {
|
} catch (CommandNoHelpException e) {
|
||||||
// Ignored
|
// Ignored
|
||||||
} catch (CommandFrameworkException e) {
|
} catch (CommandFrameworkException e) {
|
||||||
|
if (Bukkit.getServer() != null) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getBuildStackTrace());
|
Bukkit.getLogger().log(Level.SEVERE, e.getBuildStackTrace());
|
||||||
|
}
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,9 @@ public class SimpleCommandTest {
|
|||||||
public void testCommandParsing() {
|
public void testCommandParsing() {
|
||||||
try {
|
try {
|
||||||
simpleCommand.execute(new TestCommandSender(), "", new String[]{});
|
simpleCommand.execute(new TestCommandSender(), "", new String[]{});
|
||||||
} catch (SecurityException securityException) {
|
} catch (CommandFrameworkException commandFrameworkException) {
|
||||||
if (securityException.getCause().getCause() instanceof ExecutionIdentifier) {
|
if (commandFrameworkException.getCause().getCause() instanceof ExecutionIdentifier) {
|
||||||
ExecutionIdentifier executionIdentifier = (ExecutionIdentifier) securityException.getCause().getCause();
|
ExecutionIdentifier executionIdentifier = (ExecutionIdentifier) commandFrameworkException.getCause().getCause();
|
||||||
assertThat(executionIdentifier.getMessage(), is("Simple execute without any parameters"));
|
assertThat(executionIdentifier.getMessage(), is("Simple execute without any parameters"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren