public class CosmosClientException extends Exception
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 |
---|---|
CosmosResponseDiagnostics |
cosmosResponseDiagnostics()
Gets the Cosmos Response Diagnostic Statistics associated with this exception.
|
CosmosError |
error()
Gets the error code associated with the exception.
|
String |
getMessage() |
String |
message()
Gets the activity ID associated with the request.
|
Map<String,String> |
responseHeaders()
Gets the response headers as key-value pairs
|
long |
retryAfterInMilliseconds()
Gets the recommended time interval after which the client can retry failed
requests
|
int |
statusCode()
Gets the http status code.
|
int |
subStatusCode()
Gets the sub status code.
|
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public String getMessage()
getMessage
in class Throwable
public String message()
public int statusCode()
public int subStatusCode()
public CosmosError error()
public long retryAfterInMilliseconds()
public Map<String,String> responseHeaders()
public CosmosResponseDiagnostics cosmosResponseDiagnostics()
Copyright © 2019. All rights reserved.