log underlying error (#636)
This commit is contained in:
parent
05bfd33ac4
commit
bac92d6f26
|
@ -70,16 +70,15 @@ namespace StardewModdingAPI.Patches
|
||||||
CheckEventPreconditionErrorPatch.IsArbitrated = true;
|
CheckEventPreconditionErrorPatch.IsArbitrated = true;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
object isValid = CheckEventPreconditionErrorPatch.OriginalMethod.Invoke(__instance, new object[] { precondition });
|
__result = (int)CheckEventPreconditionErrorPatch.OriginalMethod.Invoke(__instance, new object[] { precondition });
|
||||||
__result = isValid is null ? -1 : (int)isValid;
|
return false;
|
||||||
}
|
}
|
||||||
catch (System.Exception ex)
|
catch (TargetInvocationException ex)
|
||||||
{
|
{
|
||||||
__result = -1;
|
__result = -1;
|
||||||
CheckEventPreconditionErrorPatch.MonitorForGame.Log($"Failed parsing event info. Event precondition: {precondition}\n{ex}", LogLevel.Error);
|
CheckEventPreconditionErrorPatch.MonitorForGame.Log($"Failed parsing event precondition ({precondition}):\n{ex.InnerException}", LogLevel.Error);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue