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;
|
||||
|
||||
CommandFrameworkException(InvocationTargetException invocationTargetException, String alias, String[] args) {
|
||||
super(invocationTargetException);
|
||||
this.invocationTargetException = invocationTargetException;
|
||||
this.alias = alias;
|
||||
this.args = args;
|
||||
|
@ -102,7 +102,9 @@ public abstract class SWCommand {
|
||||
} catch (CommandNoHelpException e) {
|
||||
// Ignored
|
||||
} catch (CommandFrameworkException e) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, e.getBuildStackTrace());
|
||||
if (Bukkit.getServer() != null) {
|
||||
Bukkit.getLogger().log(Level.SEVERE, e.getBuildStackTrace());
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
@ -39,9 +39,9 @@ public class SimpleCommandTest {
|
||||
public void testCommandParsing() {
|
||||
try {
|
||||
simpleCommand.execute(new TestCommandSender(), "", new String[]{});
|
||||
} catch (SecurityException securityException) {
|
||||
if (securityException.getCause().getCause() instanceof ExecutionIdentifier) {
|
||||
ExecutionIdentifier executionIdentifier = (ExecutionIdentifier) securityException.getCause().getCause();
|
||||
} catch (CommandFrameworkException commandFrameworkException) {
|
||||
if (commandFrameworkException.getCause().getCause() instanceof ExecutionIdentifier) {
|
||||
ExecutionIdentifier executionIdentifier = (ExecutionIdentifier) commandFrameworkException.getCause().getCause();
|
||||
assertThat(executionIdentifier.getMessage(), is("Simple execute without any parameters"));
|
||||
return;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren