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 34
34
35
35
/**
36
36
* @author Mark Vollmary
37
+ * @author Michele Rastelli
37
38
*/
38
39
public class ArangoCollectionAsyncImpl
39
40
extends InternalArangoCollection <ArangoDBAsyncImpl , ArangoDatabaseAsyncImpl , ArangoExecutorAsync >
@@ -118,18 +119,8 @@ public <T> CompletableFuture<T> getDocument(
118
119
119
120
private <T > Function <Throwable , T > handleGetDocumentExceptions (Boolean isCatchException ) {
120
121
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 ();
133
124
if ((arangoDBException .getResponseCode () != null && (arangoDBException .getResponseCode () == 404 || arangoDBException .getResponseCode () == 304
134
125
|| arangoDBException .getResponseCode () == 412 )) && isCatchException ) {
135
126
return null ;
You canβt perform that action at this time.
0 commit comments