Skip to content

Commit d6cc779

Browse files
Fix not all errors being logged to instance console
1 parent 608932d commit d6cc779

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

server/src/main/java/com/soulfiremc/server/SoulFireScheduler.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,10 @@ private Runnable wrapFuture(Runnable command) {
138138

139139
try {
140140
runnableWrapper.wrap(command).run();
141-
} catch (Exception e) {
142-
logger.error("Error in async executor", e);
143-
throw new CompletionException(e);
141+
} catch (Throwable t) {
142+
runnableWrapper.wrap(() ->
143+
logger.error("Error in async executor", t)).run();
144+
throw new CompletionException(t);
144145
}
145146
};
146147
}
@@ -153,9 +154,10 @@ private <T> Supplier<T> wrapFuture(Supplier<T> command) {
153154

154155
try {
155156
return command.get();
156-
} catch (Exception e) {
157-
logger.error("Error in async executor", e);
158-
throw new CompletionException(e);
157+
} catch (Throwable t) {
158+
runnableWrapper.wrap(() ->
159+
logger.error("Error in async executor", t)).run();
160+
throw new CompletionException(t);
159161
}
160162
};
161163
}
@@ -168,7 +170,8 @@ private void runCommand(Runnable command) {
168170
try {
169171
runnableWrapper.wrap(command).run();
170172
} catch (Throwable t) {
171-
logger.error("Error in executor", t);
173+
runnableWrapper.wrap(() ->
174+
logger.error("Error in async executor", t)).run();
172175
}
173176
}
174177

0 commit comments

Comments
 (0)