mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix #1375
This commit is contained in:
parent
47f25c4f31
commit
1b1f3bbcbe
@ -112,6 +112,7 @@ import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.Event;
|
||||
import com.sk89q.worldedit.event.platform.CommandEvent;
|
||||
import com.sk89q.worldedit.event.platform.CommandSuggestionEvent;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.internal.annotation.Selection;
|
||||
import com.sk89q.worldedit.internal.command.CommandArgParser;
|
||||
@ -910,11 +911,22 @@ public final class PlatformCommandManager {
|
||||
try {
|
||||
suggestions = commandManager.getSuggestions(access, argStrings);
|
||||
} catch (Throwable t) { // catch errors which are *not* command exceptions generated by parsers/suggesters
|
||||
if (!(t instanceof CommandException)) {
|
||||
LOGGER.error("Unexpected error occurred while generating suggestions for input: {}", arguments, t);
|
||||
return;
|
||||
if (!(t instanceof InputParseException) && !(t instanceof CommandException)) {
|
||||
Throwable cause = t;
|
||||
// These exceptions can be very nested, and should not be printed as they are not an actual error.
|
||||
boolean printError = true;
|
||||
while ((cause = cause.getCause()) != null) {
|
||||
if (cause instanceof InputParseException || cause instanceof CommandException) {
|
||||
printError = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (printError) {
|
||||
LOGGER.error("Unexpected error occurred while generating suggestions for input: {}", arguments, t);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw t;
|
||||
return;
|
||||
}
|
||||
|
||||
event.setSuggestions(suggestions.stream()
|
||||
|
Loading…
Reference in New Issue
Block a user