From a9f1067f7b7192fdb1e26db6769be7e35a1c3434 Mon Sep 17 00:00:00 2001 From: vobradovich Date: Fri, 29 Nov 2024 14:06:32 +0100 Subject: [PATCH] add ExecutionReplyException, ProgramCreationReplyException --- .../Core/RemotingViaNodeClient.cs | 21 ++++---- .../Exceptions/ExecutionReplyException.cs | 49 +++++++++++++++++++ .../ProgramCreationReplyException.cs | 48 ++++++++++++++++++ .../Exceptions/ReplyException.cs | 39 ++++----------- .../Core/RemotingViaNodeClientTests.cs | 2 +- 5 files changed, 117 insertions(+), 42 deletions(-) create mode 100644 net/src/Sails.Remoting/Exceptions/ExecutionReplyException.cs create mode 100644 net/src/Sails.Remoting/Exceptions/ProgramCreationReplyException.cs diff --git a/net/src/Sails.Remoting/Core/RemotingViaNodeClient.cs b/net/src/Sails.Remoting/Core/RemotingViaNodeClient.cs index a066631d..1f928626 100644 --- a/net/src/Sails.Remoting/Core/RemotingViaNodeClient.cs +++ b/net/src/Sails.Remoting/Core/RemotingViaNodeClient.cs @@ -90,7 +90,7 @@ public RemotingViaNodeClient( cancellationToken), extractResult: static (queuedMessageData, replyMessage) => { - EnsureSuccessOrThrowsReplyException(replyMessage.Details.Value.Code, replyMessage.Payload.Bytes); + EnsureSuccessOrThrowReplyException(replyMessage.Details.Value.Code, replyMessage.Payload.Bytes); return ( (ActorId)queuedMessageData.Value[2], replyMessage.Payload.Value.Value.Select(@byte => @byte.Value).ToArray() @@ -141,7 +141,7 @@ public async Task> MessageAsync( cancellationToken), extractResult: static (_, replyMessage) => { - EnsureSuccessOrThrowsReplyException(replyMessage.Details.Value.Code, replyMessage.Payload.Bytes); + EnsureSuccessOrThrowReplyException(replyMessage.Details.Value.Code, replyMessage.Payload.Bytes); return replyMessage.Payload.Value.Value.Select(@byte => @byte.Value).ToArray(); }, cancellationToken) @@ -172,7 +172,7 @@ public async Task QueryAsync( cancellationToken) .ConfigureAwait(false); - EnsureSuccessOrThrowsReplyException(replyInfo.Code, replyInfo.EncodedPayload); + EnsureSuccessOrThrowReplyException(replyInfo.Code, replyInfo.EncodedPayload); return replyInfo.EncodedPayload; } @@ -196,15 +196,14 @@ private static MessageQueuedEventData SelectMessageQueuedEventData(IEnumerable(() => activationReply.ReadAsync(CancellationToken.None)); + var ex = await Assert.ThrowsAsync(() => activationReply.ReadAsync(CancellationToken.None)); // Assert ex.Should().BeEquivalentTo(new