mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
fix: log some more info together with InvalidPluginException
This commit is contained in:
parent
db66513474
commit
5e2cca2cc5
1 changed files with 5 additions and 5 deletions
|
|
@ -17,7 +17,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class LocalPlugin : IDisposable
|
internal class LocalPlugin : IDisposable
|
||||||
{
|
{
|
||||||
private static readonly ModuleLog Log = new("PLUGIN");
|
private static readonly ModuleLog Log = new("LOCALPLUGIN");
|
||||||
|
|
||||||
private readonly Dalamud dalamud;
|
private readonly Dalamud dalamud;
|
||||||
private readonly FileInfo manifestFile;
|
private readonly FileInfo manifestFile;
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Dalamud.Plugin.Internal
|
||||||
this.DllFile = dllFile;
|
this.DllFile = dllFile;
|
||||||
this.State = PluginState.Unloaded;
|
this.State = PluginState.Unloaded;
|
||||||
|
|
||||||
this.loader ??= PluginLoader.CreateFromAssemblyFile(
|
this.loader = PluginLoader.CreateFromAssemblyFile(
|
||||||
this.DllFile.FullName,
|
this.DllFile.FullName,
|
||||||
config =>
|
config =>
|
||||||
{
|
{
|
||||||
|
|
@ -55,20 +55,20 @@ namespace Dalamud.Plugin.Internal
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// BadImageFormatException
|
// BadImageFormatException
|
||||||
this.pluginAssembly ??= this.loader.LoadDefaultAssembly();
|
this.pluginAssembly = this.loader.LoadDefaultAssembly();
|
||||||
|
|
||||||
// InvalidOperationException
|
// InvalidOperationException
|
||||||
this.pluginType = this.pluginAssembly.GetTypes().First(type => type.IsAssignableTo(typeof(IDalamudPlugin)));
|
this.pluginType = this.pluginAssembly.GetTypes().First(type => type.IsAssignableTo(typeof(IDalamudPlugin)));
|
||||||
|
|
||||||
assemblyVersion = this.pluginAssembly.GetName().Version;
|
assemblyVersion = this.pluginAssembly.GetName().Version;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
this.pluginAssembly = null;
|
this.pluginAssembly = null;
|
||||||
this.pluginType = null;
|
this.pluginType = null;
|
||||||
this.loader.Dispose();
|
this.loader.Dispose();
|
||||||
|
|
||||||
Log.Debug($"Not a plugin: {this.DllFile.Name}");
|
Log.Error(ex, $"Not a plugin: {this.DllFile.Name}");
|
||||||
throw new InvalidPluginException(this.DllFile);
|
throw new InvalidPluginException(this.DllFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue