From 18c5ed47e7a1f81ab9ef5407001e2f723a5363fa Mon Sep 17 00:00:00 2001
From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
Date: Wed, 19 Jun 2024 16:14:53 +0100
Subject: [PATCH] Resolved some PR comments
---
.../Bridge/BrowserBridge.cs | 45 +++++++++----------
DUI3-DX/Directory.Build.props | 7 +++
2 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs
index 5d0c0b0038..c1bbe114da 100644
--- a/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs
+++ b/DUI3-DX/DUI3/Speckle.Connectors.DUI/Bridge/BrowserBridge.cs
@@ -2,7 +2,6 @@
using System.Reflection;
using System.Runtime.InteropServices;
using Speckle.Newtonsoft.Json;
-using Speckle.Core.Logging;
using Speckle.Connectors.DUI.Bindings;
using System.Threading.Tasks.Dataflow;
using System.Diagnostics;
@@ -19,7 +18,7 @@ namespace Speckle.Connectors.DUI.Bridge;
///
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
-public class BrowserBridge : IBridge
+public sealed class BrowserBridge : IBridge
{
///
/// The name under which we expect the frontend to hoist this bindings class to the global scope.
@@ -130,10 +129,7 @@ private async Task OnActionBlock(RunMethodArgs args)
.CatchUnhandled(async () => await ExecuteMethod(args.MethodName, args.MethodArgs).ConfigureAwait(false))
.ConfigureAwait(true);
- var resultJson = JsonConvert.SerializeObject(
- result.IsSuccess ? result.Value : result.Exception,
- _serializerOptions
- );
+ string? resultJson = result.IsSuccess ? JsonConvert.SerializeObject(result.Value, _serializerOptions) : null;
NotifyUIMethodCallResultReady(args.RequestId, resultJson);
}
@@ -199,20 +195,16 @@ public void RunOnMainThread(Action action)
///
///
///
- ///
+ /// The was not found or the given were not valid for the method call
+ /// The invoked method throws an exception
/// The Json
private async Task