Fix UnresolvedDependenciesException
This commit is contained in:
parent
85bff3b14d
commit
0c77f50609
1 changed files with 12 additions and 2 deletions
|
@ -301,8 +301,18 @@ public final class Engine implements SubsystemMainClass {
|
|||
for (DependencyVector vector : resolver.resolve().getOrder()) // smol workaround
|
||||
order.add((DependencySubsystemVector) vector);
|
||||
} catch (Throwable throwable) {
|
||||
if (throwable instanceof UnmetDependenciesException)
|
||||
((UnmetDependenciesException) throwable).getUnmetDependencies();
|
||||
if (throwable instanceof UnmetDependenciesException exception) {
|
||||
Map<@NotNull DependencyVector, @NotNull String> unmetDependencies = exception.getUnmetDependencies();
|
||||
StringBuilder list = new StringBuilder();
|
||||
|
||||
for (DependencyVector vector : unmetDependencies.keySet())
|
||||
list.append("- ")
|
||||
.append(vector.getIdentifier())
|
||||
.append(": ")
|
||||
.append(unmetDependencies.get(vector));
|
||||
|
||||
logger.crash("Found unresolved dependencies:" + list, throwable);
|
||||
}
|
||||
logger.crash("An error occurred trying to resolve subsystem dependencies: " + throwable.getClass().getName() + (throwable.getMessage() == null ? "" : ": " + throwable.getMessage()));
|
||||
throw throwable;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue