@Nullable @Override public DataAccessException translateExceptionIfPossible(RuntimeException exception) { Assert.notNull(exception, "Exception must not be null!"); if (exception instanceof DataAccessException) { return (DataAccessException) exception; } if (exception instanceof NoSuchElementException || exception instanceof IndexOutOfBoundsException || exception instanceof IllegalStateException) { return new DataRetrievalFailureException(exception.getMessage(), exception); } if (exception.getClass().getName().startsWith("java")) { return new UncategorizedKeyValueException(exception.getMessage(), exception); } return null; } }
@Nullable @Override public DataAccessException translateExceptionIfPossible(RuntimeException exception) { Assert.notNull(exception, "Exception must not be null!"); if (exception instanceof DataAccessException) { return (DataAccessException) exception; } if (exception instanceof NoSuchElementException || exception instanceof IndexOutOfBoundsException || exception instanceof IllegalStateException) { return new DataRetrievalFailureException(exception.getMessage(), exception); } if (exception.getClass().getName().startsWith("java")) { return new UncategorizedKeyValueException(exception.getMessage(), exception); } return null; } }
@Nullable @Override public DataAccessException translateExceptionIfPossible(RuntimeException exception) { Assert.notNull(exception, "Exception must not be null!"); if (exception instanceof DataAccessException) { return (DataAccessException) exception; } if (exception instanceof NoSuchElementException || exception instanceof IndexOutOfBoundsException || exception instanceof IllegalStateException) { return new DataRetrievalFailureException(exception.getMessage(), exception); } if (exception.getClass().getName().startsWith("java")) { return new UncategorizedKeyValueException(exception.getMessage(), exception); } return null; } }
return new UncategorizedKeyValueException("Unexpected Aerospike Exception", cause);