Condividi tramite


CosmosException Class

Definition

The Cosmos Client exception

public class CosmosException : Exception
type CosmosException = class
    inherit Exception
Public Class CosmosException
Inherits Exception
Inheritance
CosmosException

Constructors

CosmosException(String, HttpStatusCode, Int32, String, Double)

Create a CosmosException

Properties

ActivityId

Gets the activity ID for the request from the Azure Cosmos DB service.

Diagnostics

Gets the diagnostics for the request

Headers

Gets the response headers

Message

Gets a message that describes the current exception.

RequestCharge

Gets the request charge for this request from the Azure Cosmos DB service.

ResponseBody

The body of the cosmos response message as a string

RetryAfter

Gets the retry after time. This tells how long a request should wait before doing a retry.

StackTrace

Gets a string representation of the immediate frames on the call stack.

StatusCode

Gets the request completion status code from the Azure Cosmos DB service.

SubStatusCode

Gets the request completion sub status code from the Azure Cosmos DB service.

Methods

ToString()

Create a custom string with all the relevant exception information

TryGetHeader(String, String)

Try to get a header from the cosmos response message

Applies to