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 2727import java .util .concurrent .CompletableFuture ;
2828import java .util .concurrent .CompletionException ;
2929
30+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
31+ import static com .arangodb .internal .ArangoErrors .matches ;
32+
3033/**
3134 * @author Mark Vollmary
3235 */
@@ -50,7 +53,7 @@ public CompletableFuture<Boolean> exists() {
5053 Throwable e = err instanceof CompletionException ? err .getCause () : err ;
5154 if (e instanceof ArangoDBException ) {
5255 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 )) {
5457 return false ;
5558 }
5659 }
Original file line number Diff line number Diff line change 2525import com .arangodb .ArangoView ;
2626import com .arangodb .entity .ViewEntity ;
2727
28+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
29+ import static com .arangodb .internal .ArangoErrors .matches ;
30+
2831/**
2932 * @author Mark Vollmary
3033 */
3134public class ArangoViewImpl extends InternalArangoView implements ArangoView {
3235 private final ArangoDatabase db ;
36+
3337 protected ArangoViewImpl (final ArangoDatabaseImpl db , final String name ) {
3438 super (db , db .name (), name );
3539 this .db = db ;
@@ -46,7 +50,7 @@ public boolean exists() {
4650 getInfo ();
4751 return true ;
4852 } 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 )) {
5054 return false ;
5155 }
5256 throw e ;
You can’t perform that action at this time.
0 commit comments