summaryrefslogtreecommitdiff
path: root/src/SMAPI/Patches
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-04-14 21:32:49 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-13 15:17:35 -0400
commitbac92d6f26af84f3492db1fc8d1724155d6245ee (patch)
treefb71636daed1b63de97f23eb4b4747a2850fdd82 /src/SMAPI/Patches
parent05bfd33ac4d4d089ed88fddcc8f8304ffb99f1f4 (diff)
downloadSMAPI-bac92d6f26af84f3492db1fc8d1724155d6245ee.tar.gz
SMAPI-bac92d6f26af84f3492db1fc8d1724155d6245ee.tar.bz2
SMAPI-bac92d6f26af84f3492db1fc8d1724155d6245ee.zip
log underlying error (#636)
Diffstat (limited to 'src/SMAPI/Patches')
-rw-r--r--src/SMAPI/Patches/CheckEventPreconditionErrorPatch.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/SMAPI/Patches/CheckEventPreconditionErrorPatch.cs b/src/SMAPI/Patches/CheckEventPreconditionErrorPatch.cs
index b62cf41c..673fae1c 100644
--- a/src/SMAPI/Patches/CheckEventPreconditionErrorPatch.cs
+++ b/src/SMAPI/Patches/CheckEventPreconditionErrorPatch.cs
@@ -70,16 +70,15 @@ namespace StardewModdingAPI.Patches
CheckEventPreconditionErrorPatch.IsArbitrated = true;
try
{
- object isValid = CheckEventPreconditionErrorPatch.OriginalMethod.Invoke(__instance, new object[] { precondition });
- __result = isValid is null ? -1 : (int)isValid;
+ __result = (int)CheckEventPreconditionErrorPatch.OriginalMethod.Invoke(__instance, new object[] { precondition });
+ return false;
}
- catch (System.Exception ex)
+ catch (TargetInvocationException ex)
{
__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;
}
}
}