Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 08:30:09 +01:00
Print exceptions during mapping loading
Dieser Commit ist enthalten in:
Ursprung
37f5948b0a
Commit
a16a085f75
@ -381,14 +381,23 @@ public class ProtocolRegistry {
|
||||
|
||||
public static void addMappingLoaderFuture(Class<? extends Protocol> protocolClass, Runnable runnable) {
|
||||
synchronized (MAPPING_LOADER_LOCK) {
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(runnable, mappingLoaderExecutor);
|
||||
CompletableFuture<Void> future = CompletableFuture.runAsync(runnable, mappingLoaderExecutor).exceptionally(throwable -> {
|
||||
Via.getPlatform().getLogger().severe("Error during mapping loading of " + protocolClass.getSimpleName());
|
||||
throwable.printStackTrace();
|
||||
return null;
|
||||
});
|
||||
mappingLoaderFutures.put(protocolClass, future);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addMappingLoaderFuture(Class<? extends Protocol> protocolClass, Class<? extends Protocol> dependsOn, Runnable runnable) {
|
||||
synchronized (MAPPING_LOADER_LOCK) {
|
||||
CompletableFuture<Void> future = getMappingLoaderFuture(dependsOn).whenCompleteAsync((v, throwable) -> runnable.run(), mappingLoaderExecutor);
|
||||
CompletableFuture<Void> future = getMappingLoaderFuture(dependsOn)
|
||||
.whenCompleteAsync((v, throwable) -> runnable.run(), mappingLoaderExecutor).exceptionally(throwable -> {
|
||||
Via.getPlatform().getLogger().severe("Error during mapping loading of " + protocolClass.getSimpleName());
|
||||
throwable.printStackTrace();
|
||||
return null;
|
||||
});
|
||||
mappingLoaderFutures.put(protocolClass, future);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren