Skip to content

Commit

Permalink
Replaced Throwable#printStackTraces with Logger#error
Browse files Browse the repository at this point in the history
  • Loading branch information
szumielxd committed Dec 8, 2024
1 parent 6e3ef83 commit 0adc1c1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ public static MainCommand getInstance() {
try {
injector.getInstance(command);
} catch (final Exception e) {
LOGGER.error("Failed to register command {}", command.getCanonicalName());
e.printStackTrace();
LOGGER.error(() -> "Failed to register command %s".formatted(command.getCanonicalName()), e);
}
}

Expand Down Expand Up @@ -251,7 +250,7 @@ public CompletableFuture<Boolean> execute(
} catch (CommandException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace();
LOGGER.error("A error occurred while executing plot command", e);
String message = e.getMessage();
if (message != null) {
data.player().sendMessage(
Expand Down

0 comments on commit 0adc1c1

Please sign in to comment.