Azure / Azure/azure-documentdb-java

DocumentClientException in getCause() in case of exception - Sync Vs Async behavior

Đang mở
#128 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
51
Fork
52
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

In case of an Exception, when using the Cosmos DB "Async" API, we could simply catch the generic one and simply do an e.getCause() to see if the instance was of type DocumentClientException. However, when using the DocumentDB Sync, the chain seems to be lengthier. Is this expected ?
Ofcourse, we could use something like Apache common langs 'ExceptionUtils' to check the "Cause", but is this behavior deviation known ? I have a scenario to cast the exception based on the instance check and I use both Sync and Async separately for multiple stuff.

**Example:**
_DocumentDB Sync API ADK:_
java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: com.microsoft.azure.documentdb.DocumentClientException: Message: {"Errors":["Owner resource does not exist"]}

_CosmosDB Async API SDK:_
java.util.concurrent.ExecutionException: com.microsoft.azure.cosmosdb.DocumentClientException: Message: {"Errors":["Owner resource does not exist"]}

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.