Skip to content

Commit d1dc038

Browse files
author
mpv1989
committed
Revert "Fix issue #133"
This reverts commit 068362c.
1 parent 068362c commit d1dc038

File tree

4 files changed

+3
-54
lines changed

4 files changed

+3
-54
lines changed

src/main/java/com/arangodb/ArangoCollection.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,7 @@ public <T> T getDocument(final String key, final Class<T> type, final DocumentRe
242242
if (LOGGER.isDebugEnabled()) {
243243
LOGGER.debug(e.getMessage(), e);
244244
}
245-
if (options == null || options.isCatchException()) {
246-
return null;
247-
}
248-
throw e;
245+
return null;
249246
}
250247
}
251248

@@ -524,18 +521,13 @@ public Boolean documentExists(final String key) {
524521
* @param options
525522
* Additional options, can be null
526523
* @return true if the document was found, otherwise false
527-
* @throws ArangoDBException
528-
* only thrown when {@link DocumentExistsOptions#isCatchException()} == false
529524
*/
530-
public Boolean documentExists(final String key, final DocumentExistsOptions options) throws ArangoDBException {
525+
public Boolean documentExists(final String key, final DocumentExistsOptions options) {
531526
try {
532527
executor.execute(documentExistsRequest(key, options), VPackSlice.class);
533528
return true;
534529
} catch (final ArangoDBException e) {
535-
if (options == null || options.isCatchException()) {
536-
return false;
537-
}
538-
throw e;
530+
return false;
539531
}
540532
}
541533

src/main/java/com/arangodb/model/DocumentExistsOptions.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ public class DocumentExistsOptions {
3030

3131
private String ifNoneMatch;
3232
private String ifMatch;
33-
private boolean catchException;
3433

3534
public DocumentExistsOptions() {
3635
super();
37-
catchException = true;
3836
}
3937

4038
public String getIfNoneMatch() {
@@ -65,18 +63,4 @@ public DocumentExistsOptions ifMatch(final String ifMatch) {
6563
return this;
6664
}
6765

68-
public boolean isCatchException() {
69-
return catchException;
70-
}
71-
72-
/**
73-
* @param catchException
74-
* whether or not catch possible thrown exceptions
75-
* @return options
76-
*/
77-
public DocumentExistsOptions catchException(final boolean catchException) {
78-
this.catchException = catchException;
79-
return this;
80-
}
81-
8266
}

src/main/java/com/arangodb/model/DocumentReadOptions.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ public class DocumentReadOptions {
3030

3131
private String ifNoneMatch;
3232
private String ifMatch;
33-
private boolean catchException;
3433

3534
public DocumentReadOptions() {
3635
super();
37-
catchException = true;
3836
}
3937

4038
public String getIfNoneMatch() {
@@ -65,18 +63,4 @@ public DocumentReadOptions ifMatch(final String ifMatch) {
6563
return this;
6664
}
6765

68-
public boolean isCatchException() {
69-
return catchException;
70-
}
71-
72-
/**
73-
* @param catchException
74-
* whether or not catch possible thrown exceptions
75-
* @return options
76-
*/
77-
public DocumentReadOptions catchException(final boolean catchException) {
78-
this.catchException = catchException;
79-
return this;
80-
}
81-
8266
}

src/test/java/com/arangodb/ArangoCollectionTest.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,6 @@ public void getDocumentNotFound() {
213213
assertThat(document, is(nullValue()));
214214
}
215215

216-
@Test(expected = ArangoDBException.class)
217-
public void getDocumentNotFoundThrowException() {
218-
db.collection(COLLECTION_NAME).getDocument("no", BaseDocument.class,
219-
new DocumentReadOptions().catchException(false));
220-
}
221-
222216
@Test(expected = ArangoDBException.class)
223217
public void getDocumentWrongKey() {
224218
db.collection(COLLECTION_NAME).getDocument("no/no", BaseDocument.class);
@@ -920,11 +914,6 @@ public void documentExists() {
920914
assertThat(exists, is(true));
921915
}
922916

923-
@Test(expected = ArangoDBException.class)
924-
public void documentExistsThrowExcpetion() {
925-
db.collection(COLLECTION_NAME).documentExists("no", new DocumentExistsOptions().catchException(false));
926-
}
927-
928917
@Test
929918
public void documentExistsIfMatch() {
930919
final DocumentCreateEntity<String> createResult = db.collection(COLLECTION_NAME)

0 commit comments

Comments
 (0)