Skip to content

Commit 17afbdb

Browse files
committed
Re-throw exception without modifying stack trace in InvocationHelper.EnsureSuccess method
1 parent 7f747a5 commit 17afbdb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Core/Cleipnir.ResilientFunctions/CoreRuntime/Invocation/InvocationHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.Linq;
5+
using System.Runtime.ExceptionServices;
56
using System.Threading.Tasks;
67
using Cleipnir.ResilientFunctions.CoreRuntime.ParameterSerialization;
78
using Cleipnir.ResilientFunctions.Domain;
@@ -204,7 +205,8 @@ public static void EnsureSuccess(FlowId flowId, Result<TReturn> result, bool all
204205
else
205206
throw new InvocationPostponedException(flowId, result.Postpone!.DateTime);
206207
case Outcome.Fail:
207-
throw result.Fail!;
208+
ExceptionDispatchInfo.Throw(result.Fail!);
209+
break;
208210
case Outcome.Suspend:
209211
if (allowPostponedOrSuspended)
210212
return;

0 commit comments

Comments
 (0)