### YamlMime:JavaType uid: "com.azure.cosmos.CosmosException" fullName: "com.azure.cosmos.CosmosException" name: "CosmosException" nameWithType: "CosmosException" summary: "This class defines a custom exception type for all operations on CosmosClient in the Azure Cosmos DB database service." inheritances: - "" - "" - "" - "" - "" inheritedClassMethods: - classRef: "java.lang.Object" methodsRef: - "clone" - "equals" - "finalize" - "getClass" - "hashCode" - "notify" - "notifyAll" - "wait" - "wait" - "wait" - classRef: "java.lang.Throwable" methodsRef: - "addSuppressed" - "fillInStackTrace" - "getCause" - "getLocalizedMessage" - "getMessage" - "getStackTrace" - "getSuppressed" - "initCause" - "printStackTrace" - "printStackTrace" - "printStackTrace" - "setStackTrace" - "toString" syntax: "public class **CosmosException**
extends " constructors: - uid: "com.azure.cosmos.CosmosException.CosmosException(int,com.azure.cosmos.implementation.CosmosError,java.util.Map)" fullName: "com.azure.cosmos.CosmosException.CosmosException(int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" name: "CosmosException(int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" nameWithType: "CosmosException.CosmosException(int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the http status code of the response." name: "statusCode" type: "" - description: "the error resource object." name: "cosmosErrorResource" type: "" - description: "the response headers." name: "responseHeaders" type: "Map<String,String>" syntax: "protected CosmosException(int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" desc: "Creates a new instance of the CosmosException class." - uid: "com.azure.cosmos.CosmosException.CosmosException(int,java.lang.Exception)" fullName: "com.azure.cosmos.CosmosException.CosmosException(int statusCode, Exception innerException)" name: "CosmosException(int statusCode, Exception innerException)" nameWithType: "CosmosException.CosmosException(int statusCode, Exception innerException)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the http status code of the response." name: "statusCode" type: "" - description: "the original exception." name: "innerException" type: "Exception" syntax: "protected CosmosException(int statusCode, Exception innerException)" desc: "Creates a new instance of the CosmosException class." - uid: "com.azure.cosmos.CosmosException.CosmosException(int,java.lang.String)" fullName: "com.azure.cosmos.CosmosException.CosmosException(int statusCode, String errorMessage)" name: "CosmosException(int statusCode, String errorMessage)" nameWithType: "CosmosException.CosmosException(int statusCode, String errorMessage)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the http status code of the response." name: "statusCode" type: "" - description: "the error message." name: "errorMessage" type: "String" syntax: "protected CosmosException(int statusCode, String errorMessage)" desc: "Creates a new instance of the CosmosException class." - uid: "com.azure.cosmos.CosmosException.CosmosException(int,java.lang.String,java.util.Map,java.lang.Throwable)" fullName: "com.azure.cosmos.CosmosException.CosmosException(int statusCode, String message, Map responseHeaders, Throwable cause)" name: "CosmosException(int statusCode, String message, Map responseHeaders, Throwable cause)" nameWithType: "CosmosException.CosmosException(int statusCode, String message, Map responseHeaders, Throwable cause)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the http status code of the response." name: "statusCode" type: "" - description: "the string message." name: "message" type: "String" - description: "the response headers." name: "responseHeaders" type: "Map<String,String>" - description: "the inner exception" name: "cause" type: "Throwable" syntax: "protected CosmosException(int statusCode, String message, Map responseHeaders, Throwable cause)" desc: "Creates a new instance of the CosmosException class." - uid: "com.azure.cosmos.CosmosException.CosmosException(java.lang.String,int,com.azure.cosmos.implementation.CosmosError,java.util.Map)" fullName: "com.azure.cosmos.CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" name: "CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" nameWithType: "CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the address of the resource the request is associated with." name: "resourceAddress" type: "String" - description: "the http status code of the response." name: "statusCode" type: "" - description: "the error resource object." name: "cosmosErrorResource" type: "" - description: "the response headers." name: "responseHeaders" type: "Map<String,String>" syntax: "protected CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders)" desc: "Creates a new instance of the CosmosException class." - uid: "com.azure.cosmos.CosmosException.CosmosException(java.lang.String,int,com.azure.cosmos.implementation.CosmosError,java.util.Map,java.lang.Throwable)" fullName: "com.azure.cosmos.CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders, Throwable cause)" name: "CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders, Throwable cause)" nameWithType: "CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders, Throwable cause)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the address of the resource the request is associated with." name: "resourceAddress" type: "String" - description: "the http status code of the response." name: "statusCode" type: "" - description: "the error resource object." name: "cosmosErrorResource" type: "" - description: "the response headers." name: "responseHeaders" type: "Map<String,String>" - description: "the inner exception" name: "cause" type: "Throwable" syntax: "protected CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map responseHeaders, Throwable cause)" desc: "Creates a new instance of the CosmosException class." - uid: "com.azure.cosmos.CosmosException.CosmosException(java.lang.String,java.lang.Exception,java.util.Map,int,java.lang.String)" fullName: "com.azure.cosmos.CosmosException.CosmosException(String message, Exception exception, Map responseHeaders, int statusCode, String resourceAddress)" name: "CosmosException(String message, Exception exception, Map responseHeaders, int statusCode, String resourceAddress)" nameWithType: "CosmosException.CosmosException(String message, Exception exception, Map responseHeaders, int statusCode, String resourceAddress)" summary: "Creates a new instance of the CosmosException class." modifiers: - "protected" parameters: - description: "the string message." name: "message" type: "String" - description: "the exception object." name: "exception" type: "Exception" - description: "the response headers." name: "responseHeaders" type: "Map<String,String>" - description: "the http status code of the response." name: "statusCode" type: "" - description: "the address of the resource the request is associated with." name: "resourceAddress" type: "String" syntax: "protected CosmosException(String message, Exception exception, Map responseHeaders, int statusCode, String resourceAddress)" desc: "Creates a new instance of the CosmosException class." methods: - uid: "com.azure.cosmos.CosmosException.getActivityId()" fullName: "com.azure.cosmos.CosmosException.getActivityId()" name: "getActivityId()" nameWithType: "CosmosException.getActivityId()" summary: "Gets the activity ID associated with the request." syntax: "public String getActivityId()" desc: "Gets the activity ID associated with the request." returns: description: "the activity ID." type: "String" - uid: "com.azure.cosmos.CosmosException.getDiagnostics()" fullName: "com.azure.cosmos.CosmosException.getDiagnostics()" name: "getDiagnostics()" nameWithType: "CosmosException.getDiagnostics()" summary: "Gets the Cosmos Diagnostic Statistics associated with this exception." syntax: "public CosmosDiagnostics getDiagnostics()" desc: "Gets the Cosmos Diagnostic Statistics associated with this exception." returns: description: "Cosmos Diagnostic Statistics associated with this exception." type: "" - uid: "com.azure.cosmos.CosmosException.getMessage()" fullName: "com.azure.cosmos.CosmosException.getMessage()" name: "getMessage()" nameWithType: "CosmosException.getMessage()" overridden: "java.lang.Throwable.getMessage()" syntax: "public String getMessage()" returns: type: "String" - uid: "com.azure.cosmos.CosmosException.getRequestCharge()" fullName: "com.azure.cosmos.CosmosException.getRequestCharge()" name: "getRequestCharge()" nameWithType: "CosmosException.getRequestCharge()" summary: "Gets the request charge as request units (RU) consumed by the operation." syntax: "public double getRequestCharge()" desc: "Gets the request charge as request units (RU) consumed by the operation.\n\nFor more information about the RU and factors that can impact the effective charges please visit [Request Units in Azure Cosmos DB][]\n\n\n[Request Units in Azure Cosmos DB]: https://docs.microsoft.com/en-us/azure/cosmos-db/request-units" returns: description: "the request charge." type: "" - uid: "com.azure.cosmos.CosmosException.getResponseHeaders()" fullName: "com.azure.cosmos.CosmosException.getResponseHeaders()" name: "getResponseHeaders()" nameWithType: "CosmosException.getResponseHeaders()" summary: "Gets the response headers as key-value pairs" syntax: "public Map getResponseHeaders()" desc: "Gets the response headers as key-value pairs" returns: description: "the response headers" type: "Map<String,String>" - uid: "com.azure.cosmos.CosmosException.getRetryAfterDuration()" fullName: "com.azure.cosmos.CosmosException.getRetryAfterDuration()" name: "getRetryAfterDuration()" nameWithType: "CosmosException.getRetryAfterDuration()" summary: "Gets the recommended time duration after which the client can retry failed requests" syntax: "public Duration getRetryAfterDuration()" desc: "Gets the recommended time duration after which the client can retry failed requests" returns: description: "the recommended time duration after which the client can retry failed\n requests." type: "Duration" - uid: "com.azure.cosmos.CosmosException.getShortMessage()" fullName: "com.azure.cosmos.CosmosException.getShortMessage()" name: "getShortMessage()" nameWithType: "CosmosException.getShortMessage()" summary: "Returns the error message without any diagnostics - using this method is only useful when also logging the separately." syntax: "public String getShortMessage()" desc: "Returns the error message without any diagnostics - using this method is only useful when also logging the separately. Without diagnostics it will often be impossible to determine the root cause of an error." returns: description: "the error message without any diagnostics" type: "String" - uid: "com.azure.cosmos.CosmosException.getStatusCode()" fullName: "com.azure.cosmos.CosmosException.getStatusCode()" name: "getStatusCode()" nameWithType: "CosmosException.getStatusCode()" summary: "Gets the http status code." syntax: "public int getStatusCode()" desc: "Gets the http status code." returns: description: "the status code." type: "" - uid: "com.azure.cosmos.CosmosException.getSubStatusCode()" fullName: "com.azure.cosmos.CosmosException.getSubStatusCode()" name: "getSubStatusCode()" nameWithType: "CosmosException.getSubStatusCode()" summary: "Gets the sub status code." syntax: "public int getSubStatusCode()" desc: "Gets the sub status code. The sub status code is exposed for informational purposes only - new sub status codes can be added anytime and applications should never take a dependency on certain sub status codes. For applications treating errors based on status code is sufficient." returns: description: "the sub status code." type: "" - uid: "com.azure.cosmos.CosmosException.toString()" fullName: "com.azure.cosmos.CosmosException.toString()" name: "toString()" nameWithType: "CosmosException.toString()" overridden: "java.lang.Throwable.toString()" syntax: "public String toString()" returns: type: "String" type: "class" desc: "This class defines a custom exception type for all operations on CosmosClient in the Azure Cosmos DB database service. Applications are expected to catch CosmosException and handle errors as appropriate when calling methods on CosmosClient.\n\nErrors coming from the service during normal execution are converted to CosmosException before returning to the application with the following exception:\n\nWhen a BE error is encountered during a QueryIterable iteration, an IllegalStateException is thrown instead of CosmosException.\n\nWhen a transport level error happens that request is not able to reach the service, an IllegalStateException is thrown instead of CosmosException." metadata: {} package: "com.azure.cosmos" artifact: com.azure:azure-cosmos:4.63.4