Skip to content

Commit bec5416

Browse files
committed
Preserve fatal CQRS stream failures
1 parent 125b37f commit bec5416

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎ManagedCode.Communication/Cqrs/CqrsStream.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private static async Task ProduceAsync<TProgress, TResult>(
172172
{
173173
// Consumer went away (or cancelled): nothing left to report, just close the channel below.
174174
}
175-
catch (Exception exception)
175+
catch (Exception exception) when (exception is not (OutOfMemoryException or StackOverflowException or AccessViolationException))
176176
{
177177
try
178178
{

‎ManagedCode.Communication/Cqrs/CqrsStreamNormalizer.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static async IAsyncEnumerable<CqrsStreamChunk<TProgress, TResult>> Normal
4444
ExceptionDispatchInfo.Capture(passthrough.Inner).Throw();
4545
throw; // Unreachable; keeps the compiler happy about `moved`.
4646
}
47-
catch (Exception exception)
47+
catch (Exception exception) when (exception is not (OutOfMemoryException or StackOverflowException or AccessViolationException))
4848
{
4949
cancellationToken.ThrowIfCancellationRequested();
5050
faultChunk = CqrsStreamChunk<TProgress, TResult>.FromException(

0 commit comments

Comments
 (0)