From e5b355afaa0749e2845956bd22c40a684809dae0 Mon Sep 17 00:00:00 2001 From: Eric Bowden Date: Fri, 1 May 2026 10:29:04 -0500 Subject: [PATCH] Preserve stack trace when rethrowing snapshot exception in ExecuteAction --- src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs b/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs index 2bafa2d..835c2e8 100644 --- a/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs +++ b/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Runtime.ExceptionServices; using System.Threading; using Adaptive.Aeron; using Adaptive.Aeron.Exceptions; @@ -979,7 +980,7 @@ private void ExecuteAction(ClusterAction action, long logPosition, long leadersh if (null != exception) { - throw exception; + ExceptionDispatchInfo.Capture(exception).Throw(); } } }