mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 21:24:16 +01:00
Add a verbose log message, bring type selection out from the exception
This commit is contained in:
parent
53f7e9a4f4
commit
e2dfcca482
1 changed files with 20 additions and 17 deletions
|
|
@ -5,6 +5,7 @@ using System.Reflection;
|
||||||
|
|
||||||
using Dalamud.Plugin.Ipc.Exceptions;
|
using Dalamud.Plugin.Ipc.Exceptions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace Dalamud.Plugin.Ipc.Internal
|
namespace Dalamud.Plugin.Ipc.Internal
|
||||||
{
|
{
|
||||||
|
|
@ -147,6 +148,9 @@ namespace Dalamud.Plugin.Ipc.Internal
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
Log.Verbose($"Could not convert {obj.GetType().Name} to {type.Name}, will look for compatible type instead");
|
||||||
|
}
|
||||||
|
|
||||||
// If type -> type fails, try to find an object that matches.
|
// If type -> type fails, try to find an object that matches.
|
||||||
var sourceType = obj.GetType();
|
var sourceType = obj.GetType();
|
||||||
var fieldNames = sourceType.GetFields(BindingFlags.Public | BindingFlags.Instance)
|
var fieldNames = sourceType.GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||||
|
|
@ -168,7 +172,6 @@ namespace Dalamud.Plugin.Ipc.Internal
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue