Azure / Azure/azure-documentdb-java
DocumentClientException in getCause() in case of exception - Sync Vs Async behavior
- Lingua principale
- Java
- Stelle
- 51
- Fork
- 52
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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"]}
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia riproducendo le catene di eccezioni mostrate per la DocumentDB Sync API e la Cosmos DB Async API, concentrandoti su come DocumentClientException viene incapsulata ed esposta tramite getCause(). Confronta il comportamento osservato con la gestione delle eccezioni documentata dell’SDK; il lavoro è completato quando il comportamento sincrono rispetto a quello asincrono è confermato e documentato chiaramente, oppure viene definita una modifica attuabile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100