@@ -29,6 +29,8 @@ public static List<PluginPair> Plugins(List<PluginMetadata> metadatas, PluginsSe
29
29
30
30
public static IEnumerable < PluginPair > DotNetPlugins ( List < PluginMetadata > source )
31
31
{
32
+ var erroredPlugins = new List < string > ( ) ;
33
+
32
34
var plugins = new List < PluginPair > ( ) ;
33
35
var metadatas = source . Where ( o => AllowedLanguage . IsDotNet ( o . Language ) ) ;
34
36
@@ -50,6 +52,8 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
50
52
}
51
53
catch ( Exception e )
52
54
{
55
+ erroredPlugins . Add ( metadata . Name ) ;
56
+
53
57
Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Couldn't load assembly for { metadata . Name } ", e ) ;
54
58
return ;
55
59
}
@@ -63,11 +67,15 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
63
67
}
64
68
catch ( InvalidOperationException e )
65
69
{
70
+ erroredPlugins . Add ( metadata . Name ) ;
71
+
66
72
Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Can't find class implement IPlugin for <{ metadata . Name } >", e ) ;
67
73
return ;
68
74
}
69
75
catch ( ReflectionTypeLoadException e )
70
76
{
77
+ erroredPlugins . Add ( metadata . Name ) ;
78
+
71
79
Log . Exception ( $ "|PluginsLoader.DotNetPlugins|The GetTypes method was unable to load assembly types for <{ metadata . Name } >", e ) ;
72
80
return ;
73
81
}
@@ -79,6 +87,7 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
79
87
}
80
88
catch ( Exception e )
81
89
{
90
+ erroredPlugins . Add ( metadata . Name ) ;
82
91
Log . Exception ( $ "|PluginsLoader.DotNetPlugins|Can't create instance for <{ metadata . Name } >", e ) ;
83
92
return ;
84
93
}
@@ -93,6 +102,19 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
93
102
metadata . InitTime += milliseconds ;
94
103
95
104
}
105
+
106
+ if ( erroredPlugins . Count > 0 )
107
+ {
108
+ var errorPluginString = "" ;
109
+
110
+ erroredPlugins . ForEach ( x => errorPluginString += x + Environment . NewLine ) ;
111
+
112
+ Task . Run ( ( ) =>
113
+ {
114
+ MessageBox . Show ( $ "Uh oh, unable to load plugins:{ Environment . NewLine } { errorPluginString } ") ;
115
+ } ) ;
116
+ }
117
+
96
118
return plugins ;
97
119
}
98
120
0 commit comments