Index: src/org/openstreetmap/josm/plugins/PluginHandler.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/plugins/PluginHandler.java b/src/org/openstreetmap/josm/plugins/PluginHandler.java
--- a/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 18531)
+++ b/src/org/openstreetmap/josm/plugins/PluginHandler.java	(date 1659532664589)
@@ -80,6 +80,8 @@
 import org.openstreetmap.josm.tools.ResourceProvider;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReport;
+import org.openstreetmap.josm.tools.bugreport.ReportedException;
 
 /**
  * PluginHandler is basically a collection of static utility functions used to bootstrap
@@ -806,6 +808,7 @@
      */
     private static void loadPlugin(Component parent, PluginInformation plugin, PluginClassLoader pluginClassLoader) {
         String msg = tr("Could not load plugin {0}. Delete from preferences?", "'"+plugin.name+"'");
+        Exception exception = null;
         try {
             Class<?> klass = plugin.loadClass(pluginClassLoader);
             if (klass != null) {
@@ -822,13 +825,24 @@
                 msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>"
                         + "Delete from preferences?</html>", "'"+Utils.escapeReservedCharactersHTML(plugin.name)+"'", plugin.className);
             }
+            exception = e;
         } catch (RuntimeException e) { // NOPMD
             pluginLoadingExceptions.put(plugin.name, e);
             Logging.error(e);
+            exception = e;
         }
         if (msg != null && confirmDisablePlugin(parent, msg, plugin.name)) {
             PreferencesUtils.removeFromList(Config.getPref(), "plugins", plugin.name);
         }
+        if (exception != null) {
+            ReportedException reportedException = BugReport.intercept(exception);
+            reportedException.startSection("Failing plugin");
+            reportedException.put("name", plugin.name);
+            reportedException.put("localVersion", plugin.localversion);
+            reportedException.put("version", plugin.version);
+            reportedException.put("downloadlink", plugin.downloadlink);
+            reportedException.warn();
+        }
     }
 
     /**
