你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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()

Creates an instance of 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()

Creates an instance of 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