Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

DocumentClientException Success instead of NotFound #46

Description

@fileman

Hi, I've a test for NotFound resource by using wrong id.
DocumentClient throw this exception "Microsoft.Azure.Documents.DocumentClientException: Message: {"Errors":["Resource Not Found"]}" in Visual Studio Locals tab $exception variable, but CosmonautClient return Success and no exception catched.

try
{
       result = await cosmosService.EntityStore.UpdateAsync(Entity.Value);
}
catch (DocumentClientException ex)
{
       var error = ex; //Breakpoint here ignored
       throw;
}

return result.Exception is null ? // this is null
     (ActionResult)new OkObjectResult($"Success") : 
     new BadRequestObjectResult($"Error");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions