Class CosmosExceptionUtils
java.lang.Object
com.azure.spring.data.cosmos.exception.CosmosExceptionUtils
To handle and throw a cosmos db exception when access the database
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Mono<T>
exceptionHandler
(String message, Throwable throwable, ResponseDiagnosticsProcessor responseDiagnosticsProcessor) To throw a CosmosDBAccessExceptionstatic <T> Mono<T>
findAPIExceptionHandler
(String message, Throwable throwable, ResponseDiagnosticsProcessor responseDiagnosticsProcessor) To find an exceptionHandler for a exception and return empty Mono if the exception status code is not found
-
Constructor Details
-
CosmosExceptionUtils
public CosmosExceptionUtils()
-
-
Method Details
-
exceptionHandler
public static <T> Mono<T> exceptionHandler(String message, Throwable throwable, ResponseDiagnosticsProcessor responseDiagnosticsProcessor) To throw a CosmosDBAccessException- Type Parameters:
T
- type class of Mono- Parameters:
message
- the detail messagethrowable
- exceptionresponseDiagnosticsProcessor
- response diagnostics processor- Returns:
- Mono instance
- Throws:
CosmosAccessException
- for operations on cosmos db
-
findAPIExceptionHandler
public static <T> Mono<T> findAPIExceptionHandler(String message, Throwable throwable, ResponseDiagnosticsProcessor responseDiagnosticsProcessor) To find an exceptionHandler for a exception and return empty Mono if the exception status code is not found- Type Parameters:
T
- type class of Mono- Parameters:
message
- the detail messagethrowable
- exceptionresponseDiagnosticsProcessor
- Response Diagnostics Processor- Returns:
- Mono instance
- Throws:
CosmosAccessException
- for operations on cosmos db
-