azure-docs-sdk-java/docs-ref-autogen/com.azure.cosmos.CosmosExce...

290 строки
22 KiB
YAML

### 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 Cosmos<wbr>Client in the Azure Cosmos DB database service."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Throwable?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.Exception?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"java.lang.RuntimeException?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
- "<xref href=\"com.azure.core.exception.AzureException?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#addSuppressed-java.lang.Throwable-\">addSuppressed</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#fillInStackTrace--\">fillInStackTrace</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getCause--\">getCause</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getLocalizedMessage--\">getLocalizedMessage</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getMessage--\">getMessage</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getStackTrace--\">getStackTrace</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getSuppressed--\">getSuppressed</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#initCause-java.lang.Throwable-\">initCause</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace--\">printStackTrace</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-java.io.PrintStream-\">printStackTrace</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-java.io.PrintWriter-\">printStackTrace</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#setStackTrace-java.lang.StackTraceElement:A-\">setStackTrace</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#toString--\">toString</a>"
syntax: "public class **CosmosException**</br> extends <xref href=\"com.azure.core.exception.AzureException?alt=com.azure.core.exception.AzureException&text=AzureException\" data-throw-if-not-resolved=\"False\" />"
constructors:
- uid: "com.azure.cosmos.CosmosException.CosmosException(int,com.azure.cosmos.implementation.CosmosError,java.util.Map<java.lang.String,java.lang.String>)"
fullName: "com.azure.cosmos.CosmosException.CosmosException(int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders)"
name: "CosmosException(int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders)"
nameWithType: "CosmosException.CosmosException(int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders)"
summary: "Creates a new instance of the Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the error resource object."
name: "cosmosErrorResource"
type: "<xref href=\"com.azure.cosmos.implementation.CosmosError?alt=com.azure.cosmos.implementation.CosmosError&text=CosmosError\" data-throw-if-not-resolved=\"False\" />"
- description: "the response headers."
name: "responseHeaders"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "protected CosmosException(int statusCode, CosmosError cosmosErrorResource, Map<String,String> 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 Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the original exception."
name: "innerException"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html\">Exception</a>"
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 Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the error message."
name: "errorMessage"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
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.String,java.lang.String>,java.lang.Throwable)"
fullName: "com.azure.cosmos.CosmosException.CosmosException(int statusCode, String message, Map<String,String> responseHeaders, Throwable cause)"
name: "CosmosException(int statusCode, String message, Map<String,String> responseHeaders, Throwable cause)"
nameWithType: "CosmosException.CosmosException(int statusCode, String message, Map<String,String> responseHeaders, Throwable cause)"
summary: "Creates a new instance of the Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the string message."
name: "message"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the response headers."
name: "responseHeaders"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "the inner exception"
name: "cause"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
syntax: "protected CosmosException(int statusCode, String message, Map<String,String> 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<java.lang.String,java.lang.String>)"
fullName: "com.azure.cosmos.CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders)"
name: "CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders)"
nameWithType: "CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders)"
summary: "Creates a new instance of the Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the address of the resource the request is associated with."
name: "resourceAddress"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the error resource object."
name: "cosmosErrorResource"
type: "<xref href=\"com.azure.cosmos.implementation.CosmosError?alt=com.azure.cosmos.implementation.CosmosError&text=CosmosError\" data-throw-if-not-resolved=\"False\" />"
- description: "the response headers."
name: "responseHeaders"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "protected CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> 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.String,java.lang.String>,java.lang.Throwable)"
fullName: "com.azure.cosmos.CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders, Throwable cause)"
name: "CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders, Throwable cause)"
nameWithType: "CosmosException.CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> responseHeaders, Throwable cause)"
summary: "Creates a new instance of the Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the address of the resource the request is associated with."
name: "resourceAddress"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the error resource object."
name: "cosmosErrorResource"
type: "<xref href=\"com.azure.cosmos.implementation.CosmosError?alt=com.azure.cosmos.implementation.CosmosError&text=CosmosError\" data-throw-if-not-resolved=\"False\" />"
- description: "the response headers."
name: "responseHeaders"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "the inner exception"
name: "cause"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html\">Throwable</a>"
syntax: "protected CosmosException(String resourceAddress, int statusCode, CosmosError cosmosErrorResource, Map<String,String> 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<java.lang.String,java.lang.String>,int,java.lang.String)"
fullName: "com.azure.cosmos.CosmosException.CosmosException(String message, Exception exception, Map<String,String> responseHeaders, int statusCode, String resourceAddress)"
name: "CosmosException(String message, Exception exception, Map<String,String> responseHeaders, int statusCode, String resourceAddress)"
nameWithType: "CosmosException.CosmosException(String message, Exception exception, Map<String,String> responseHeaders, int statusCode, String resourceAddress)"
summary: "Creates a new instance of the Cosmos<wbr>Exception class."
modifiers:
- "protected"
parameters:
- description: "the string message."
name: "message"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the exception object."
name: "exception"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html\">Exception</a>"
- description: "the response headers."
name: "responseHeaders"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "the http status code of the response."
name: "statusCode"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- description: "the address of the resource the request is associated with."
name: "resourceAddress"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "protected CosmosException(String message, Exception exception, Map<String,String> 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: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- 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: "<xref href=\"com.azure.cosmos.CosmosDiagnostics?alt=com.azure.cosmos.CosmosDiagnostics&text=CosmosDiagnostics\" data-throw-if-not-resolved=\"False\" />"
- 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: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- 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: "<xref href=\"double?alt=double&text=double\" data-throw-if-not-resolved=\"False\" />"
- 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<String,String> getResponseHeaders()"
desc: "Gets the response headers as key-value pairs"
returns:
description: "the response headers"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- 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: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
- 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 <xref uid=\"com.azure.cosmos.CosmosException.getDiagnostics()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosException#getDiagnostics()\"></xref> separately."
syntax: "public String getShortMessage()"
desc: "Returns the error message without any diagnostics - using this method is only useful when also logging the <xref uid=\"com.azure.cosmos.CosmosException.getDiagnostics()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosException#getDiagnostics()\"></xref> 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: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- 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: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- 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: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
- 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: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
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<T> 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.3