mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 14:58:35 +00:00
Improve exceptions (#1256)
- Kick more exceptions further up the pipeline to be more likely to be shown to player - Try to avoid lots of console spamming when it's the same error multiple times - Allow parsing of FaweExceptions during commands to better give information to players
This commit is contained in:
@ -774,19 +774,18 @@ public final class PlatformCommandManager {
|
||||
}
|
||||
actor.printError(e.getRichMessage());
|
||||
} catch (CommandExecutionException e) {
|
||||
handleUnknownException(actor, e.getCause());
|
||||
} catch (CommandException e) {
|
||||
if (e.getCause() instanceof FaweException) {
|
||||
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", ((FaweException) e.getCause()).getComponent()));
|
||||
} else {
|
||||
handleUnknownException(actor, e.getCause());
|
||||
}
|
||||
} catch (CommandException e) {
|
||||
Component msg = e.getRichMessage();
|
||||
if (msg != TextComponent.empty()) {
|
||||
actor.print(TextComponent.builder("")
|
||||
.append(e.getRichMessage())
|
||||
.build());
|
||||
List<String> argList = parseArgs(event.getArguments()).map(Substring::getSubstring).collect(Collectors.toList());
|
||||
printUsage(actor, argList);
|
||||
Component msg = e.getRichMessage();
|
||||
if (msg != TextComponent.empty()) {
|
||||
List<String> argList = parseArgs(event.getArguments())
|
||||
.map(Substring::getSubstring)
|
||||
.collect(Collectors.toList());
|
||||
printUsage(actor, argList);
|
||||
}
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
handleUnknownException(actor, t);
|
||||
|
Reference in New Issue
Block a user