Skip to content

Commit

Permalink
Updated default Error to capture exception context, updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed May 22, 2023
1 parent 11e1ce1 commit d4bddff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/IO.Ably.Shared/Realtime/Workflows/RealtimeWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ ErrorInfo GetErrorInfoFromTransportException(Exception ex, ErrorInfo @default)
return ErrorInfo.ReasonRefused;
}

@default.InnerException = ex;
return @default;
}

Expand Down
6 changes: 4 additions & 2 deletions src/IO.Ably.Tests.Shared/Realtime/PresenceSandboxSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1714,12 +1714,12 @@ public async Task ChannelStateCondition_WhenQueueMessagesIsFalse_ShouldFailAckQu

await tsc.Task;

// No pending message queue, since QueueMessages is false
// No pending message queue, since QueueMessages=false
channel.RealtimeClient.State.PendingMessages.Should().HaveCount(0);

await WaitFor(500, done =>
{
// Ack cleared after flushing the queue for transport disconnection.
// Ack cleared after flushing the queue for transport disconnection, because QueueMessages=false
if (channel.RealtimeClient.State.WaitingForAck.Count == 0)
{
done();
Expand All @@ -1729,6 +1729,8 @@ await WaitFor(500, done =>
success.Should().HaveValue();
success.Value.Should().BeFalse();
err.Should().NotBeNull();
err.Message.Should().Be("Clearing message AckQueue(created at connected state) because Options.QueueMessages is false");
err.Cause.InnerException.Message.Should().Be("RTP16b : error while sending message");

// clean up
client.Close();
Expand Down

0 comments on commit d4bddff

Please sign in to comment.