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 3030import java .util .concurrent .CompletableFuture ;
3131import java .util .concurrent .CompletionException ;
3232
33+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
34+ import static com .arangodb .internal .ArangoErrors .matches ;
35+
3336/**
3437 * @author Michele Rastelli
3538 */
@@ -54,7 +57,7 @@ public CompletableFuture<Boolean> exists() {
5457 Throwable e = err instanceof CompletionException ? err .getCause () : err ;
5558 if (e instanceof ArangoDBException ) {
5659 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 )) {
5861 return false ;
5962 }
6063 }
Original file line number Diff line number Diff line change 2828import com .arangodb .model .arangosearch .SearchAliasCreateOptions ;
2929import com .arangodb .model .arangosearch .SearchAliasPropertiesOptions ;
3030
31+ import static com .arangodb .internal .ArangoErrors .ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ;
32+ import static com .arangodb .internal .ArangoErrors .matches ;
33+
3134/**
3235 * @author Michele Rastelli
3336 */
3437public class SearchAliasImpl extends InternalSearchAlias implements SearchAlias {
3538 private final ArangoDatabase db ;
39+
3640 protected SearchAliasImpl (final ArangoDatabaseImpl db , final String name ) {
3741 super (db , db .name (), name );
3842 this .db = db ;
@@ -49,7 +53,7 @@ public boolean exists() {
4953 getInfo ();
5054 return true ;
5155 } 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 )) {
5357 return false ;
5458 }
5559 throw e ;
You can’t perform that action at this time.
0 commit comments