Class CosmosExceptionUtils
- java.lang.Object
-
- com.azure.spring.data.cosmos.exception.CosmosExceptionUtils
-
public class CosmosExceptionUtils extends Object
To handle and throw a cosmos db exception when access the database
-
-
Constructor Summary
Constructors Constructor Description CosmosExceptionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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
-
-
-
Method Detail
-
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
-
-