Compartilhar via


CosmosExceptionUtils Class

  • java.lang.Object
    • com.azure.spring.data.cosmos.exception.CosmosExceptionUtils

public class CosmosExceptionUtils

To handle and throw a cosmos db exception when access the database

Constructor Summary

Constructor Description
CosmosExceptionUtils()

Method Summary

Modifier and Type Method and Description
static Mono<T> exceptionHandler(String message, Throwable throwable, ResponseDiagnosticsProcessor responseDiagnosticsProcessor)

To throw a CosmosDBAccessException

static 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

Methods inherited from java.lang.Object

Constructor Details

CosmosExceptionUtils

public CosmosExceptionUtils()

Method Details

exceptionHandler

public static Mono<T> <T>exceptionHandler(String message, Throwable throwable, ResponseDiagnosticsProcessor responseDiagnosticsProcessor)

To throw a CosmosDBAccessException

Parameters:

message - the detail message
throwable - exception
responseDiagnosticsProcessor - response diagnostics processor

Returns:

Mono instance

findAPIExceptionHandler

public static Mono<T> <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

Parameters:

message - the detail message
throwable - exception
responseDiagnosticsProcessor - Response Diagnostics Processor

Returns:

Mono instance

Applies to