Class CosmosAccessException

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
All Implemented Interfaces:
Serializable

public class CosmosAccessException extends org.springframework.dao.DataAccessException
Public class extending DataAccessException, exposes innerException. Every API in CosmosRepository and ReactiveCosmosRepository 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.
See Also:
  • 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(@Nullable String msg, @Nullable Throwable cause)
      Construct a CosmosDBAccessException with the specified detail message. and nested exception.
      Parameters:
      msg - the detail message
      cause - the nested Throwable
    • CosmosAccessException

      public CosmosAccessException(@Nullable String msg, @Nullable Exception cause)
      Construct a CosmosDBAccessException with the specified detail message and nested exception.
      Parameters:
      msg - the detail message
      cause - the nested exception
  • Method Details

    • getCosmosException

      public CosmosException getCosmosException()
      To get exception object for cosmos client
      Returns:
      CosmosException