File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
src/main/java/com/arangodb/internal Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 3434
3535/**
3636 * @author Mark Vollmary
37+ * @author Michele Rastelli
3738 */
3839public class ArangoCollectionAsyncImpl
3940 extends InternalArangoCollection <ArangoDBAsyncImpl , ArangoDatabaseAsyncImpl , ArangoExecutorAsync >
@@ -118,18 +119,8 @@ public <T> CompletableFuture<T> getDocument(
118119
119120 private <T > Function <Throwable , T > handleGetDocumentExceptions (Boolean isCatchException ) {
120121 return throwable -> {
121- ArangoDBException arangoDBException = null ;
122-
123- if (throwable instanceof ArangoDBException ) {
124- arangoDBException = (ArangoDBException ) throwable ;
125- } else if (throwable instanceof CompletionException ) {
126- CompletionException completionException = (CompletionException ) throwable ;
127- if (completionException .getCause () instanceof ArangoDBException ) {
128- arangoDBException = (ArangoDBException ) completionException .getCause ();
129- }
130- }
131-
132- if (arangoDBException != null ) {
122+ if (throwable instanceof CompletionException && throwable .getCause () instanceof ArangoDBException ) {
123+ ArangoDBException arangoDBException = (ArangoDBException ) throwable .getCause ();
133124 if ((arangoDBException .getResponseCode () != null && (arangoDBException .getResponseCode () == 404 || arangoDBException .getResponseCode () == 304
134125 || arangoDBException .getResponseCode () == 412 )) && isCatchException ) {
135126 return null ;
You can’t perform that action at this time.
0 commit comments