Skip to content

Commit

Permalink
Direct: Adds version 3.28.2 (#3236)
Browse files Browse the repository at this point in the history
* add (to be added internally) substatus code to MalformedContinuationTokenException before it gets wrapped into 400

* Bump direct version

* fix test to expect new channel closed substatus code and message format

* remove debug print
  • Loading branch information
imanvt authored Jun 9, 2022
1 parent 01e5b29 commit 4875e45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ClientOfficialVersion>3.27.2</ClientOfficialVersion>
<ClientPreviewVersion>3.27.2</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.28.1</DirectVersion>
<DirectVersion>3.28.2</DirectVersion>
<EncryptionOfficialVersion>1.0.1</EncryptionOfficialVersion>
<EncryptionPreviewVersion>1.0.1</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview</EncryptionPreviewSuffixVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ private QueryExceptionConverter()

public override CosmosException Visit(MalformedContinuationTokenException malformedContinuationTokenException, ITrace trace)
{
Headers headers = new Headers()
{
SubStatusCode = Documents.SubStatusCodes.MalformedContinuationToken
};
return CosmosExceptionFactory.CreateBadRequestException(
message: malformedContinuationTokenException.Message,
headers: new Headers(),
headers: headers,
stackTrace: malformedContinuationTokenException.StackTrace,
innerException: malformedContinuationTokenException,
trace: trace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ private void ValidateTransportException(ResponseMessage responseMessage)
Assert.AreEqual(HttpStatusCode.ServiceUnavailable, responseMessage.StatusCode);
string message = responseMessage.ErrorMessage;
Assert.AreEqual(message, responseMessage.CosmosException.Message);
Assert.IsTrue(message.Contains($"ServiceUnavailable (503); Substatus: {(int)SubStatusCodes.TransportGenerated503}; ActivityId:"));
Assert.IsTrue(message.Contains("Reason: (Message: Channel is closed"), "Should contain exception message");
Assert.IsTrue(message.Contains($"ServiceUnavailable (503); Substatus: {(int)SubStatusCodes.Channel_Closed}; ActivityId:"));
Assert.IsTrue(message.Contains("Reason: (Channel is closed"), "Should contain exception message");
string diagnostics = responseMessage.Diagnostics.ToString();
Assert.IsNotNull(diagnostics);
Assert.IsTrue(diagnostics.Contains("TransportException: A client transport error occurred: The connection failed"));
Expand Down

0 comments on commit 4875e45

Please sign in to comment.