From a59536946b8d899f8d1b161f5662010886e21995 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Thu, 23 Feb 2023 01:36:45 -0800
Subject: [PATCH] Properly log any Throwable on plugin class creation (#8897)

---
 patches/server/Paper-Plugins.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/patches/server/Paper-Plugins.patch b/patches/server/Paper-Plugins.patch
index 3913a769fb..8712d09bb8 100644
--- a/patches/server/Paper-Plugins.patch
+++ b/patches/server/Paper-Plugins.patch
@@ -2292,7 +2292,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                            javapluginsLoaded.add(new ProviderPair<>(file, loadedPlugin));
 +                        }
 +
-+                    } catch (Exception ex) {
++                    } catch (Throwable ex) {
 +                        LOGGER.log(Level.SEVERE, "Could not load '" + file.getSource() + "' in folder '" + file.getParentSource() + "'", ex); // Paper
 +                    }
 +                }
@@ -2324,7 +2324,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                                javapluginsLoaded.add(new ProviderPair<>(file, loadedPlugin));
 +                            }
 +                            break;
-+                        } catch (Exception ex) {
++                        } catch (Throwable ex) {
 +                            LOGGER.log(Level.SEVERE, "Could not load '" + file.getSource() + "' in folder '" + file.getParentSource() + "'", ex); // Paper
 +                        }
 +                    }
@@ -2382,7 +2382,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +@SuppressWarnings("UnstableApiUsage")
 +public class ModernPluginLoadingStrategy<T> implements ProviderLoadingStrategy<T> {
 +
-+    private static final Logger LOGGER = LogUtils.getLogger();
++    private static final Logger LOGGER = LogUtils.getClassLogger();
 +    private final ProviderConfiguration<T> configuration;
 +
 +    public ModernPluginLoadingStrategy(ProviderConfiguration<T> onLoad) {
@@ -2489,7 +2489,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                if (this.configuration.load(retrievedProvider, instance)) {
 +                    loadedPlugins.add(new ProviderPair<>(retrievedProvider, instance));
 +                }
-+            } catch (Exception ex) {
++            } catch (Throwable ex) {
 +                LOGGER.error("Could not load plugin '%s' in folder '%s'".formatted(retrievedProvider.getFileName(), retrievedProvider.getParentSource()), ex); // Paper
 +            }
 +        }