DocumentClientException 类

定义

This class defines a custom exception type for all operations on DocumentClient in the Azure Cosmos DB database service. Applications are expected to catch DocumentClientException and handle errors as appropriate when calling methods on DocumentClient.

Errors coming from the service during normal execution are converted to DocumentClientException before returning to the application with the following exception:

When a BE error is encountered during a QueryIterable<T> iteration, an IllegalStateException is thrown instead of DocumentClientException.

When a transport level error happens that request is not able to reach the service, an IllegalStateException is thrown instead of DocumentClientException.

public class DocumentClientException
继承
java.lang.Object
Exception
DocumentClientException

构造函数

DocumentClientException(int statusCode)

Creates a new instance of the DocumentClientException class.

DocumentClientException(int statusCode, Error errorResource, Map<String, String> responseHeaders)

Creates a new instance of the DocumentClientException class.

DocumentClientException(int statusCode, Exception innerException)

Creates a new instance of the DocumentClientException class.

DocumentClientException(int statusCode, Exception innerException, Map<String, String> responseHeaders)

Creates a new instance of the DocumentClientException class.

<xreftitle>Deprecated</xreftitle>

<xrefdescription>

  <p>this constructor is deprecated and is used internally only. </p>

</xrefdescription>

DocumentClientException(int statusCode, String errorMessage)

Creates a new instance of the DocumentClientException class.

DocumentClientException(String resourceAddress, int statusCode, Error errorResource, Map<String, String> responseHeaders)

Creates a new instance of the DocumentClientException class.

方法

getActivityId()

Gets the activity ID associated with the request.

getError()

Gets the error code associated with the exception.

getResponseHeaders()

Gets the response headers as key-value pairs

getRetryAfterInMilliseconds()

Gets the recommended time interval after which the client can retry failed requests

getStatusCode()

Gets the http status code.

getSubStatusCode()

Gets the sub status code.

适用于