diff --git a/src/Adaptive.Agrona/Concurrent/AgentTerminationException.cs b/src/Adaptive.Agrona/Concurrent/AgentTerminationException.cs index c7cbca7..e6350e3 100644 --- a/src/Adaptive.Agrona/Concurrent/AgentTerminationException.cs +++ b/src/Adaptive.Agrona/Concurrent/AgentTerminationException.cs @@ -11,5 +11,9 @@ public AgentTerminationException() public AgentTerminationException(string message) : base(message) { } + + public AgentTerminationException(Exception innerException) : base(innerException?.ToString(), innerException) + { + } } } \ No newline at end of file diff --git a/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs b/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs index 2bafa2d..394a0d2 100644 --- a/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs +++ b/src/Adaptive.Cluster/Service/ClusteredServiceAgent.cs @@ -906,7 +906,7 @@ private long OnTakeSnapshot(long logPosition, long leadershipTermId) { if (ex.ErrorCode == ArchiveException.STORAGE_SPACE) { - throw new AgentTerminationException(); + throw new AgentTerminationException(ex); } throw;