public class CosmosClientException extends RuntimeException
Errors coming from the service during normal execution are converted to CosmosClientException 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 CosmosClientException.
When a transport level error happens that request is not able to reach the service, an IllegalStateException is thrown instead of CosmosClientException.
Modifier and Type | Method and Description |
---|---|
String |
getActivityId()
Gets the activity ID associated with the request.
|
CosmosResponseDiagnostics |
getCosmosResponseDiagnostics()
Gets the Cosmos Response Diagnostic Statistics associated with this exception.
|
CosmosError |
getError()
Gets the error code associated with the exception.
|
String |
getMessage() |
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 |
setResourceAddress(String resourceAddress) |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public String getMessage()
getMessage
in class Throwable
public String getActivityId()
public int getStatusCode()
public int getSubStatusCode()
public CosmosError getError()
public long getRetryAfterInMilliseconds()
public Map<String,String> getResponseHeaders()
public CosmosResponseDiagnostics getCosmosResponseDiagnostics()
public void setResourceAddress(String resourceAddress)
Copyright © 2020 Microsoft Corporation. All rights reserved.