From 2fc0024cd24cb1d8d8fce201bed3ff93945ce382 Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Mon, 17 Mar 2025 12:08:42 +0000 Subject: [PATCH] Cancellation check for sending needs to not be wrapped --- src/Speckle.Sdk/Serialisation/V2/Send/SerializeProcess.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Speckle.Sdk/Serialisation/V2/Send/SerializeProcess.cs b/src/Speckle.Sdk/Serialisation/V2/Send/SerializeProcess.cs index 04edb89e..50fff486 100644 --- a/src/Speckle.Sdk/Serialisation/V2/Send/SerializeProcess.cs +++ b/src/Speckle.Sdk/Serialisation/V2/Send/SerializeProcess.cs @@ -89,11 +89,12 @@ public sealed class SerializeProcess( public void ThrowIfFailed() { + //always check for cancellation first + cancellationToken.ThrowIfCancellationRequested(); if (Exception is not null) { throw new SpeckleException("Error while sending", Exception); } - cancellationToken.ThrowIfCancellationRequested(); } private async Task WaitForSchedulerCompletion()