Skip to content

Commit

Permalink
Now logs the stacktrace when on async
Browse files Browse the repository at this point in the history
  • Loading branch information
Metaphoriker committed Jun 26, 2024
1 parent ce6bea9 commit 957b256
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ private SnapshotManager determineSnapshotManager(
@NonNull PathPosition target,
@Nullable List<PathFilter> filters) {

if (filters == null)
filters = Collections.emptyList();
if (filters == null) filters = Collections.emptyList();

raiseStartEvent(start, target, filters);

Expand Down Expand Up @@ -139,7 +138,7 @@ private CompletionStage<PathfinderResult> initiateAsyncPathing(
try {
return resolvePath(start, target, filters);
} catch (Exception e) {
throw ErrorLogger.logFatalError("Failed to find path async", e);
throw ErrorLogger.logFatalErrorWithStacktrace("Failed to find path async", e);
}
},
PATHING_EXECUTOR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ public static IllegalStateException logFatalError(String message, Throwable caus
log.error("OS: {}", System.getProperty("os.name"));
log.error("OS Architecture: {}", System.getProperty("os.arch"));
log.error("===============================");
log.error("Stacktrace:", cause);
return new IllegalStateException(message, cause);
}

public static IllegalStateException logFatalErrorWithStacktrace(String message, Throwable cause) {
IllegalStateException exception = logFatalError(message, cause);
log.error("Stacktrace:", cause);
return exception;
}
}

0 comments on commit 957b256

Please sign in to comment.