Add exception handling for SerializeProcess with CancellationTokenSource (#211)

* Add exception handling for SerializeProcess with CancellationTokenSource

* formatting

* add exception test to make sure we handle a server exception

* add extra exception and handling to stop

* add comment and another test

* one last chance for user to cancel

* formatting
This commit is contained in:
Adam Hathcock
2025-01-23 17:06:08 +00:00
committed by GitHub
parent cc23c147be
commit f81fc97a91
13 changed files with 285 additions and 37 deletions
@@ -1,3 +1,4 @@
using Microsoft.Extensions.Logging;
using Speckle.Sdk.Serialisation.V2.Receive;
using Speckle.Sdk.Serialisation.V2.Send;
using Speckle.Sdk.SQLite;
@@ -28,7 +29,8 @@ public class SerializeProcessFactory(
IObjectSerializerFactory objectSerializerFactory,
IObjectDeserializerFactory objectDeserializerFactory,
ISqLiteJsonCacheManagerFactory sqLiteJsonCacheManagerFactory,
IServerObjectManagerFactory serverObjectManagerFactory
IServerObjectManagerFactory serverObjectManagerFactory,
ILoggerFactory loggerFactory
) : ISerializeProcessFactory
{
public ISerializeProcess CreateSerializeProcess(
@@ -47,6 +49,7 @@ public class SerializeProcessFactory(
serverObjectManager,
baseChildFinder,
objectSerializerFactory,
loggerFactory,
options
);
}