From 6e462b0025b2c658f2e258b531b7f7c4aee4415c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=A5=D1=83=D1=85=D0=BB=D0=B0=D0=B5=D0=B2?= Date: Tue, 7 May 2024 12:39:42 +0300 Subject: [PATCH] Do not hide errors during deserialization Deserialization errors may occur when using bison, for example, if the object being deserialized has several constructors, none of which is marked with the JsonConstructor attribute. As a result, the RPC may freeze. --- CoreRemoting/RemotingClient.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CoreRemoting/RemotingClient.cs b/CoreRemoting/RemotingClient.cs index 1524a1d..b210da6 100644 --- a/CoreRemoting/RemotingClient.cs +++ b/CoreRemoting/RemotingClient.cs @@ -616,8 +616,10 @@ private void ProcessRpcResultMessage(WireMessage message) } catch (Exception e) { - Console.WriteLine(e); - throw; + clientRpcContext.Error = true; + clientRpcContext.RemoteException = new RemoteInvocationException( + message: e.Message, + innerEx: e.GetType().IsSerializable ? e : null); } } clientRpcContext.WaitHandle.Set();