mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 20:07:41 +01:00
Properly log any Throwable on plugin class creation (#8897)
This commit is contained in:
parent
4ad4252079
commit
a59536946b
@ -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
|
||||
+ }
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user