Azure / Azure/azure-documentdb-java

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

オープン
#128 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
51
フォーク
52
PR マージ指標
30日以内にマージされた PR はありません

説明

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"]}

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、DocumentDB Sync API と Cosmos DB Async API について示されている例外チェーンを再現し、DocumentClientException がどのようにラップされ、getCause() を通じて公開されるかに注目します。観測された動作を SDK に記載されている例外処理と比較します。同期と非同期の動作が確認されて明確に文書化されるか、実行可能な変更が定義されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api, backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。