CosmosAccessException Class

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.core.NestedRuntimeException
            • org.springframework.dao.DataAccessException
              • com.azure.spring.data.cosmos.exception.CosmosAccessException

public class CosmosAccessException
extends org.springframework.dao.DataAccessException

Public class extending DataAccessException, exposes innerException. Every API in CosmosRepository<T,ID> and ReactiveCosmosRepository<T,K> should throw CosmosAccessException. innerException refers to the exception thrown by CosmosDB SDK. Callers of repository APIs can rely on innerException for any retriable logic, or for more details on the failure of the operation.

Field Summary

Modifier and Type Field and Description
protected final CosmosException cosmosException

Cosmos exception.

Constructor Summary

Constructor Description
CosmosAccessException(String msg)

Construct a CosmosDBAccessException with the specified detail message.

CosmosAccessException(String msg, Exception cause)

Construct a CosmosDBAccessException with the specified detail message and nested exception.

CosmosAccessException(String msg, Throwable cause)

Construct a CosmosDBAccessException with the specified detail message.

Method Summary

Modifier and Type Method and Description
CosmosException getCosmosException()

To get exception object for cosmos client

Methods inherited from java.lang.Object

Methods inherited from java.lang.Throwable

Methods inherited from org.springframework.core.NestedRuntimeException

org.springframework.core.NestedRuntimeException.contains(java.lang.Class< org.springframework.core.NestedRuntimeException.getMessage org.springframework.core.NestedRuntimeException.getMostSpecificCause org.springframework.core.NestedRuntimeException.getRootCause

Field Details

cosmosException

protected final CosmosException cosmosException

Cosmos exception.

Constructor Details

CosmosAccessException

public CosmosAccessException(String msg)

Construct a CosmosDBAccessException with the specified detail message.

Parameters:

msg - the detail message

CosmosAccessException

public CosmosAccessException(String msg, Exception cause)

Construct a CosmosDBAccessException with the specified detail message and nested exception.

Parameters:

msg - the detail message
cause - the nested exception

CosmosAccessException

public CosmosAccessException(String msg, Throwable cause)

Construct a CosmosDBAccessException with the specified detail message. and nested exception.

Parameters:

msg - the detail message
cause - the nested Throwable

Method Details

getCosmosException

public CosmosException getCosmosException()

To get exception object for cosmos client

Returns:

CosmosException

Applies to