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 27
27
import java .util .concurrent .CompletableFuture ;
28
28
import java .util .concurrent .CompletionException ;
29
29
30
+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
31
+ import static com .arangodb .internal .ArangoErrors .matches ;
32
+
30
33
/**
31
34
* @author Mark Vollmary
32
35
*/
@@ -50,7 +53,7 @@ public CompletableFuture<Boolean> exists() {
50
53
Throwable e = err instanceof CompletionException ? err .getCause () : err ;
51
54
if (e instanceof ArangoDBException ) {
52
55
ArangoDBException aEx = (ArangoDBException ) e ;
53
- if (ArangoErrors . ERROR_ARANGO_DATA_SOURCE_NOT_FOUND . equals (aEx . getErrorNum () )) {
56
+ if (matches (aEx , 404 , ERROR_ARANGO_DATA_SOURCE_NOT_FOUND )) {
54
57
return false ;
55
58
}
56
59
}
Original file line number Diff line number Diff line change 25
25
import com .arangodb .ArangoView ;
26
26
import com .arangodb .entity .ViewEntity ;
27
27
28
+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
29
+ import static com .arangodb .internal .ArangoErrors .matches ;
30
+
28
31
/**
29
32
* @author Mark Vollmary
30
33
*/
31
34
public class ArangoViewImpl extends InternalArangoView implements ArangoView {
32
35
private final ArangoDatabase db ;
36
+
33
37
protected ArangoViewImpl (final ArangoDatabaseImpl db , final String name ) {
34
38
super (db , db .name (), name );
35
39
this .db = db ;
@@ -46,7 +50,7 @@ public boolean exists() {
46
50
getInfo ();
47
51
return true ;
48
52
} catch (final ArangoDBException e ) {
49
- if (ArangoErrors . ERROR_ARANGO_DATA_SOURCE_NOT_FOUND . equals ( e . getErrorNum () )) {
53
+ if (matches ( e , 404 , ERROR_ARANGO_DATA_SOURCE_NOT_FOUND )) {
50
54
return false ;
51
55
}
52
56
throw e ;
You can’t perform that action at this time.
0 commit comments