From 32b9534cd1bdb32b5a02bd6cad7fedee6f70313f Mon Sep 17 00:00:00 2001 From: Steve Halliwell Date: Sat, 3 Oct 2020 17:55:44 +1000 Subject: [PATCH] Merge pull request #889 from snozbot/feature/LogCommandExceptionLocation Add Log of Location for Command Execute Exceptions --- Assets/Fungus/Scripts/Components/Block.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets/Fungus/Scripts/Components/Block.cs b/Assets/Fungus/Scripts/Components/Block.cs index f727cf09..1be1f33b 100644 --- a/Assets/Fungus/Scripts/Components/Block.cs +++ b/Assets/Fungus/Scripts/Components/Block.cs @@ -312,7 +312,20 @@ namespace Fungus // set it here in case a command starts and finishes execution before the next window update. command.ExecutingIconTimer = Time.realtimeSinceStartup + FungusConstants.ExecutingIconFadeTime; BlockSignals.DoCommandExecute(this, command, i, commandList.Count); + +#if UNITY_EDITOR + try + { + command.Execute(); + } + catch (Exception) + { + Debug.LogError("Rethrowing Exception thrown by:" + command.GetLocationIdentifier()); + throw; + } +#else command.Execute(); +#endif // Wait until the executing command sets another command to jump to via Command.Continue() while (jumpToCommandIndex == -1)