Skip to content

Commit 58d139c

Browse files
committed
add better console error message for plugin load error
1 parent 2e6952e commit 58d139c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

MainWindow.xaml.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,21 @@ private async void Main()
137137
}
138138
}
139139
}
140+
catch (ReflectionTypeLoadException rex)
141+
{
142+
Log.Write($"Error loading plugin {pluginDLL}: {rex.Message}");
143+
144+
foreach (var loaderException in rex.LoaderExceptions)
145+
{
146+
Log.Write(" - " + loaderException?.Message);
147+
}
148+
}
140149
catch (Exception ex)
141150
{
142-
Console.WriteLine($"Error loading plugin {pluginDLL}: {ex.Message}");
151+
Log.Write($"General error loading plugin {pluginDLL}: {ex.Message}");
143152
}
144153
}
145-
}
154+
} // if plugins folder exists
146155

147156
//return;
148157

0 commit comments

Comments
 (0)