Update debug logging for plugin fails

This commit is contained in:
Kurt 2021-09-16 17:04:34 -07:00
parent 4fb0f96dc4
commit d2d71494e3

View file

@ -28,7 +28,8 @@ namespace PKHeX.WinForms
catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
{
System.Diagnostics.Debug.WriteLine($"Unable to load plugin [{t.Name}]: {t.FullName}", ex.Message);
System.Diagnostics.Debug.WriteLine($"Unable to load plugin [{t.Name}]: {t.FullName}");
System.Diagnostics.Debug.WriteLine(ex.Message);
continue;
}
if (activate != null)
@ -67,8 +68,17 @@ namespace PKHeX.WinForms
catch (Exception ex)
#pragma warning restore CA1031 // Do not catch general exception types
{
System.Diagnostics.Debug.WriteLine($"Unable to load plugin [{pluginType.Name}]: {z.FullName}", ex.Message);
return Enumerable.Empty<Type>();
System.Diagnostics.Debug.WriteLine($"Unable to load plugin [{pluginType.Name}]: {z.FullName}");
System.Diagnostics.Debug.WriteLine(ex.Message);
if (ex is ReflectionTypeLoadException rtle)
{
foreach (var le in rtle.LoaderExceptions)
{
if (le is not null)
System.Diagnostics.Debug.WriteLine(le.Message);
}
}
return Array.Empty<Type>();
}
}