fix for all expansions stop loading after an exception is thrown (#1094)

This commit is contained in:
Kqliber 2025-01-08 18:21:43 +00:00
parent b838d1c52a
commit 787a053d98
No known key found for this signature in database
GPG Key ID: 1000A497ACD28BA4

View File

@ -37,6 +37,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.stream.Collectors;
import me.clip.placeholderapi.PlaceholderAPIPlugin;
import me.clip.placeholderapi.events.ExpansionRegisterEvent;
@ -66,6 +67,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import javax.swing.text.html.Option;
public final class LocalExpansionManager implements Listener {
@NotNull
@ -440,7 +443,8 @@ public final class LocalExpansionManager implements Listener {
Msg.severe("Failed to load expansion %s (is a dependency missing?)", e, file.getName());
return null;
} catch (Exception e) {
throw new CompletionException(e.getMessage() + " (expansion file: " + file.getAbsolutePath() + ")", e);
plugin.getLogger().log(Level.SEVERE, "Failed to load expansion file: " + file.getAbsolutePath(), e);
return null;
}
});
}