@Test public void logsExceptionItselfIfNoSQLException() { DataAccessException e = new DataAccessException("BAZ"); mapper.logException(0, e); verify(logger).error(anyString(), eq(e)); }
@Override protected void logException(long id, DataAccessException exception) { final Throwable cause = exception.getCause(); if (cause instanceof SQLException) { for (Throwable throwable : (SQLException) cause) { logger.error(formatLogMessage(id, throwable), throwable); } } else { logger.error(formatLogMessage(id, exception), exception); } }
LoggingDataAccessExceptionMapper extends LoggingExceptionMapper<DataAccessException> { @Override protected void logException(long id, DataAccessException exception) { final Throwable cause = exception.getCause(); if (cause instanceof SQLException) { for (Throwable throwable : (SQLException) cause) { logger.error(formatLogMessage(id, throwable), throwable); } } else { logger.error(formatLogMessage(id, exception), exception); } } }
LoggingDataAccessExceptionMapper extends LoggingExceptionMapper<DataAccessException> { @Override protected void logException(long id, DataAccessException exception) { final Throwable cause = exception.getCause(); if (cause instanceof SQLException) { for (Throwable throwable : (SQLException) cause) { logger.error(formatLogMessage(id, throwable), throwable); } } else { logger.error(formatLogMessage(id, exception), exception); } }  }
LoggingDataAccessExceptionMapper extends LoggingExceptionMapper<DataAccessException> { @Override protected void logException(long id, DataAccessException exception) { final Throwable cause = exception.getCause(); if (cause instanceof SQLException) { for (Throwable throwable : (SQLException) cause) { logger.error(formatLogMessage(id, throwable), throwable); } } else { logger.error(formatLogMessage(id, exception), exception); } }   }
LoggingDataAccessExceptionMapper extends LoggingExceptionMapper<DataAccessException> { @Override protected void logException(long id, DataAccessException exception) { final Throwable cause = exception.getCause(); if (cause instanceof SQLException) { for (Throwable throwable : (SQLException) cause) { logger.error(formatLogMessage(id, throwable), throwable); } } else { logger.error(formatLogMessage(id, exception), exception); } }    }