File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
core/src/main/java/com/arangodb/internal Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 30
30
import java .util .concurrent .CompletableFuture ;
31
31
import java .util .concurrent .CompletionException ;
32
32
33
+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
34
+ import static com .arangodb .internal .ArangoErrors .matches ;
35
+
33
36
/**
34
37
* @author Michele Rastelli
35
38
*/
@@ -54,7 +57,7 @@ public CompletableFuture<Boolean> exists() {
54
57
Throwable e = err instanceof CompletionException ? err .getCause () : err ;
55
58
if (e instanceof ArangoDBException ) {
56
59
ArangoDBException aEx = (ArangoDBException ) e ;
57
- if (ArangoErrors . ERROR_ARANGO_DATA_SOURCE_NOT_FOUND . equals (aEx . getErrorNum () )) {
60
+ if (matches (aEx , 404 , ERROR_ARANGO_DATA_SOURCE_NOT_FOUND )) {
58
61
return false ;
59
62
}
60
63
}
Original file line number Diff line number Diff line change 28
28
import com .arangodb .model .arangosearch .SearchAliasCreateOptions ;
29
29
import com .arangodb .model .arangosearch .SearchAliasPropertiesOptions ;
30
30
31
+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
32
+ import static com .arangodb .internal .ArangoErrors .matches ;
33
+
31
34
/**
32
35
* @author Michele Rastelli
33
36
*/
34
37
public class SearchAliasImpl extends InternalSearchAlias implements SearchAlias {
35
38
private final ArangoDatabase db ;
39
+
36
40
protected SearchAliasImpl (final ArangoDatabaseImpl db , final String name ) {
37
41
super (db , db .name (), name );
38
42
this .db = db ;
@@ -49,7 +53,7 @@ public boolean exists() {
49
53
getInfo ();
50
54
return true ;
51
55
} catch (final ArangoDBException e ) {
52
- if (ArangoErrors . ERROR_ARANGO_DATA_SOURCE_NOT_FOUND . equals ( e . getErrorNum () )) {
56
+ if (matches ( e , 404 , ERROR_ARANGO_DATA_SOURCE_NOT_FOUND )) {
53
57
return false ;
54
58
}
55
59
throw e ;
You can’t perform that action at this time.
0 commit comments