@@ -239,6 +239,10 @@ private String determineDocumentKeyFromId(final Object id) {
239239 return MetadataUtils .determineDocumentKeyFromId (converter .convertId (id ));
240240 }
241241
242+ public RuntimeException translateException (RuntimeException e ) {
243+ return DataAccessUtils .translateIfNecessary (e , exceptionTranslator );
244+ }
245+
242246 @ Override
243247 public ArangoDB driver () {
244248 return arango ;
@@ -252,7 +256,7 @@ public ArangoDBVersion getVersion() throws DataAccessException {
252256 }
253257 return version ;
254258 } catch (final ArangoDBException e ) {
255- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
259+ throw translateException ( e );
256260 }
257261 }
258262
@@ -280,7 +284,7 @@ public <T> ArangoCursor<T> query(final String query, final Map<String, Object> b
280284 ArangoCursor <T > cursor = db ().query (query , entityClass , bindVars == null ? null : prepareBindVars (bindVars ), options );
281285 return new ArangoExtCursor <>(cursor , entityClass , eventPublisher );
282286 } catch (final ArangoDBException e ) {
283- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
287+ throw translateException ( e );
284288 }
285289 }
286290
@@ -309,7 +313,7 @@ public <T> MultiDocumentEntity<DocumentDeleteEntity<T>> deleteAll(
309313 try {
310314 result = _collection (entityClass ).deleteDocuments (toList (values ), options , entityClass );
311315 } catch (final ArangoDBException e ) {
312- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
316+ throw translateException ( e );
313317 }
314318
315319 potentiallyEmitAfterDeleteEvent (values , entityClass , result );
@@ -327,8 +331,14 @@ public MultiDocumentEntity<DocumentDeleteEntity<?>> deleteAll(
327331
328332 @ Override
329333 public <T > MultiDocumentEntity <DocumentDeleteEntity <T >> deleteAllById (Iterable <?> ids , DocumentDeleteOptions options , Class <T > entityClass ) throws DataAccessException {
334+ if (ids == null ) {
335+ throw new IllegalArgumentException ("ids must not be null" );
336+ }
330337 ArrayList <String > convertedIds = new ArrayList <>();
331338 for (Object id : ids ) {
339+ if (id == null ) {
340+ throw new IllegalArgumentException ("id must not be null" );
341+ }
332342 convertedIds .add (converter .convertId (id ));
333343 }
334344 return deleteAll (convertedIds , options , entityClass );
@@ -350,7 +360,7 @@ public <T> DocumentDeleteEntity<T> delete(final Object id, final DocumentDeleteO
350360 try {
351361 result = _collection (entityClass , id ).deleteDocument (determineDocumentKeyFromId (id ), options , entityClass );
352362 } catch (final ArangoDBException e ) {
353- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
363+ throw translateException ( e );
354364 }
355365
356366 potentiallyEmitEvent (new AfterDeleteEvent <>(id , entityClass ));
@@ -375,7 +385,7 @@ public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateAll(
375385 try {
376386 result = _collection (entityClass ).updateDocuments (toList (values ), options , entityClass );
377387 } catch (final ArangoDBException e ) {
378- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
388+ throw translateException ( e );
379389 }
380390
381391 updateDBFields (values , result );
@@ -402,7 +412,7 @@ public <T> DocumentUpdateEntity<T> update(final Object id, final T value, final
402412 try {
403413 result = _collection (value .getClass (), id ).updateDocument (determineDocumentKeyFromId (id ), value , options );
404414 } catch (final ArangoDBException e ) {
405- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
415+ throw translateException ( e );
406416 }
407417
408418 updateDBFields (value , result );
@@ -428,7 +438,7 @@ public <T> MultiDocumentEntity<DocumentUpdateEntity<T>> replaceAll(
428438 try {
429439 result = _collection (entityClass ).replaceDocuments (toList (values ), options , entityClass );
430440 } catch (final ArangoDBException e ) {
431- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
441+ throw translateException ( e );
432442 }
433443
434444 updateDBFields (values , result );
@@ -454,7 +464,7 @@ public <T> DocumentUpdateEntity<T> replace(final Object id, final T value, final
454464 try {
455465 result = _collection (value .getClass (), id ).replaceDocument (determineDocumentKeyFromId (id ), value , options );
456466 } catch (final ArangoDBException e ) {
457- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
467+ throw translateException ( e );
458468 }
459469
460470 updateDBFields (value , result );
@@ -477,7 +487,7 @@ public <T> Optional<T> find(final Object id, final Class<T> entityClass, final D
477487 }
478488 return Optional .ofNullable (res );
479489 } catch (final ArangoDBException e ) {
480- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
490+ throw translateException ( e );
481491 }
482492 }
483493
@@ -507,7 +517,7 @@ public <T> Iterable<T> findAll(final Iterable<?> ids, final Class<T> entityClass
507517 }
508518 return docs ;
509519 } catch (final ArangoDBException e ) {
510- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
520+ throw translateException ( e );
511521 }
512522 }
513523
@@ -521,7 +531,7 @@ public <T> MultiDocumentEntity<DocumentCreateEntity<T>> insertAll(
521531 try {
522532 result = _collection (entityClass ).insertDocuments (toList (values ), options , entityClass );
523533 } catch (final ArangoDBException e ) {
524- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
534+ throw translateException ( e );
525535 }
526536
527537 updateDBFields (values , result );
@@ -543,7 +553,7 @@ public <T> DocumentCreateEntity<T> insert(final T value, final DocumentCreateOpt
543553 try {
544554 result = _collection (value .getClass ()).insertDocument (value , options );
545555 } catch (final ArangoDBException e ) {
546- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
556+ throw translateException ( e );
547557 }
548558
549559 updateDBFields (value , result );
@@ -576,7 +586,7 @@ public <T> T repsert(final T value) throws DataAccessException {
576586 );
577587 result = it .hasNext () ? it .next () : null ;
578588 } catch (final ArangoDBException e ) {
579- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
589+ throw translateException ( e );
580590 }
581591
582592 updateDBFieldsFromObject (value , result );
@@ -606,7 +616,7 @@ public <T> Iterable<T> repsertAll(final Iterable<T> values, final Class<? super
606616 entityClass
607617 ).asListRemaining ();
608618 } catch (final ArangoDBException e ) {
609- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
619+ throw translateException ( e );
610620 }
611621
612622 updateDBFieldsFromObjects (values , result );
@@ -694,7 +704,7 @@ public boolean exists(final Object id, final Class<?> entityClass) throws DataAc
694704 try {
695705 return _collection (entityClass ).documentExists (determineDocumentKeyFromId (id ));
696706 } catch (final ArangoDBException e ) {
697- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
707+ throw translateException ( e );
698708 }
699709 }
700710
@@ -704,7 +714,7 @@ public void dropDatabase() throws DataAccessException {
704714 try {
705715 db .drop ();
706716 } catch (final ArangoDBException e ) {
707- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
717+ throw translateException ( e );
708718 }
709719 databaseCache .remove (db .name ());
710720 collectionCache .keySet ().stream ().filter (key -> key .getDb ().equals (db .name ()))
@@ -741,7 +751,7 @@ public Iterable<UserEntity> getUsers() throws DataAccessException {
741751 try {
742752 return arango .getUsers ();
743753 } catch (final ArangoDBException e ) {
744- throw DataAccessUtils . translateIfNecessary ( e , exceptionTranslator );
754+ throw translateException ( e );
745755 }
746756 }
747757
0 commit comments