public class DocumentClientException extends Exception
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.
| Constructor and Description |
|---|
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,
String errorMessage)
Creates a new instance of the
DocumentClientException class. |
DocumentClientException(String message,
Exception exception,
Map<String,String> responseHeaders,
int statusCode,
String resourceAddress)
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. |
| Modifier and Type | Method and Description |
|---|---|
String |
getActivityId()
Gets the activity ID associated with the request.
|
ClientSideRequestStatistics |
getClientSideRequestStatistics()
Gets the Client side request statistics associated with this exception.
|
Error |
getError()
Gets the error code associated with the exception.
|
long |
getLsn()
Gets the LSN associated with this
exception. |
String |
getMessage() |
String |
getPartitionKeyRangeId() |
Map<String,String> |
getRequestHeaders() |
com.microsoft.azure.cosmosdb.internal.directconnectivity.Uri |
getRequestUri() |
Map<String,String> |
getResponseHeaders()
Gets the response headers as key-value pairs
|
long |
getRetryAfterInMilliseconds()
Gets the recommended time interval after which the client can retry
failed requests
|
int |
getStatusCode()
Gets the http status code.
|
int |
getSubStatusCode()
Gets the sub status code.
|
void |
setClientSideRequestStatistics(ClientSideRequestStatistics clientSideRequestStatistics)
Sets the Client side request statistics associated with this exception.
|
void |
setRequestUri(com.microsoft.azure.cosmosdb.internal.directconnectivity.Uri requestUri) |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTracepublic DocumentClientException(int statusCode)
DocumentClientException class.statusCode - the http status code of the response.public DocumentClientException(int statusCode,
String errorMessage)
DocumentClientException class.statusCode - the http status code of the response.errorMessage - the error message.public DocumentClientException(int statusCode,
Exception innerException)
DocumentClientException class.statusCode - the http status code of the response.innerException - the original exception.public DocumentClientException(int statusCode,
Error errorResource,
Map<String,String> responseHeaders)
DocumentClientException class.statusCode - the http status code of the response.errorResource - the error resource object.responseHeaders - the response headers.public DocumentClientException(String resourceAddress, int statusCode, Error errorResource, Map<String,String> responseHeaders)
DocumentClientException class.resourceAddress - the address of the resource the request is associated with.statusCode - the http status code of the response.errorResource - the error resource object.responseHeaders - the response headers.public DocumentClientException(String message, Exception exception, Map<String,String> responseHeaders, int statusCode, String resourceAddress)
DocumentClientException class.message - the string message.statusCode - the http status code of the response.exception - the exception object.responseHeaders - the response headers.resourceAddress - the address of the resource the request is associated with.public String getActivityId()
public ClientSideRequestStatistics getClientSideRequestStatistics()
public void setClientSideRequestStatistics(ClientSideRequestStatistics clientSideRequestStatistics)
public Error getError()
public long getLsn()
exception.exception.public String getMessage()
getMessage in class Throwablepublic String getPartitionKeyRangeId()
public com.microsoft.azure.cosmosdb.internal.directconnectivity.Uri getRequestUri()
public void setRequestUri(com.microsoft.azure.cosmosdb.internal.directconnectivity.Uri requestUri)
public Map<String,String> getResponseHeaders()
public long getRetryAfterInMilliseconds()
public int getStatusCode()
public int getSubStatusCode()
Copyright © 2020. All rights reserved.