Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statistics not getting populated correctly on CosmosException #845

Closed
ealsur opened this issue Sep 24, 2019 · 0 comments · Fixed by #846
Closed

Statistics not getting populated correctly on CosmosException #845

ealsur opened this issue Sep 24, 2019 · 0 comments · Fixed by #846
Assignees
Labels
bug Something isn't working

Comments

@ealsur
Copy link
Member

ealsur commented Sep 24, 2019

Describe the bug
When a CosmosException is generated, the statistics information is missing from the Message.

To Reproducestring invalidSessionToken = "0:-1#20";

        try
        {
            ItemResponse<ToDoActivity> readResponse = await this.Container.ReadItemAsync<ToDoActivity>(temp.id, new Cosmos.PartitionKey(temp.status), new ItemRequestOptions() { SessionToken = invalidSessionToken });
            Assert.Fail("Should had thrown ReadSessionNotAvailable");
        }
        catch (CosmosException cosmosException)
        {
            Assert.IsTrue(cosmosException.Message.Contains("RequestStartTime:"));
        }

Expected behavior
The Message needs to contain the statistics, and not the text "Microsoft.Azure.Cosmos.CosmosClientSideRequestStatistics"

Environment summary
SDK Version: 3.2.0
OS Version (e.g. Windows, Linux, MacOSX) Any

@ealsur ealsur added the bug Something isn't working label Sep 24, 2019
@ealsur ealsur self-assigned this Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant