Don't swallow random exceptions, don't bother with CommandExceptions

This commit is contained in:
ZacSharp 2023-06-20 01:32:18 +02:00
parent b111fd2f3e
commit f7a20a3acf
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
2 changed files with 6 additions and 1 deletions

View File

@ -373,6 +373,8 @@ public class ArgConsumer implements IArgConsumer {
public <T extends IDatatype> Stream<String> tabCompleteDatatype(T datatype) {
try {
return datatype.tabComplete(this.context);
} catch (CommandException ignored) {
// NOP
} catch (Exception e) {
e.printStackTrace();
}

View File

@ -151,9 +151,12 @@ public class CommandManager implements ICommandManager {
private Stream<String> tabComplete() {
try {
return this.command.tabComplete(this.label, this.args);
} catch (CommandException ignored) {
// NOP
} catch (Throwable t) {
return Stream.empty();
t.printStackTrace();
}
return Stream.empty();
}
}
}