From a77e559c7983c399e8e7bc4e18eb74afbf1dba80 Mon Sep 17 00:00:00 2001 From: skadefro Date: Wed, 14 Dec 2022 13:42:39 +0100 Subject: [PATCH 1/2] skip v4.6 --- PatchVSCode/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PatchVSCode/Program.cs b/PatchVSCode/Program.cs index 98b9654b..712278fe 100644 --- a/PatchVSCode/Program.cs +++ b/PatchVSCode/Program.cs @@ -20,7 +20,7 @@ private static async Task MainAsync() await DownloadAndCopyFramework4_0(); await DownloadAndCopyFramework4_5(); await DownloadAndCopyFramework4_6(); - await DownloadAndCopyFramework4_62(); + //await DownloadAndCopyFramework4_62(); } public static async Task DownloadAndCopyFramework4_62() From e580901610fa9ff8ad508480c43041e4be3ff324 Mon Sep 17 00:00:00 2001 From: skadefro Date: Wed, 14 Dec 2022 13:42:54 +0100 Subject: [PATCH 2/2] Throw original exception in Invoke Code --- OpenRPA.Script/Activities/InvokeCode.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/OpenRPA.Script/Activities/InvokeCode.cs b/OpenRPA.Script/Activities/InvokeCode.cs index fdbe72a1..ad0d2946 100644 --- a/OpenRPA.Script/Activities/InvokeCode.cs +++ b/OpenRPA.Script/Activities/InvokeCode.cs @@ -16,6 +16,7 @@ using System.Collections; using System.Collections.ObjectModel; using Python.Runtime; +using NLog.Targets; namespace OpenRPA.Script.Activities { @@ -471,17 +472,26 @@ public void CompileAndRun(string language, string code, string[] references, Dic if (methInfo != null) { - ExceptionDispatchInfo exceptionDispatchInfo = null; try { methInfo.Invoke(null, new object[] { }); } - catch (Exception ex) + catch (TargetInvocationException ex) { - exceptionDispatchInfo = ExceptionDispatchInfo.Capture(ex); + if(ex.InnerException != null) throw ex.InnerException; + throw ex; } - - if (exceptionDispatchInfo != null) exceptionDispatchInfo.Throw(); + //ExceptionDispatchInfo exceptionDispatchInfo = null; + //try + //{ + // methInfo.Invoke(null, new object[] { }); + //} + //catch (Exception ex) + //{ + // exceptionDispatchInfo = ExceptionDispatchInfo.Capture(ex); + //} + + //if (exceptionDispatchInfo != null) exceptionDispatchInfo.Throw(); var vars = context.DataContext.GetProperties(); foreach (dynamic v in vars)