class LogOrRethrowExceptionHandler implements ExceptionHandler {

	/**
	 * Logging levels for the handler.
	 *
	 * @author Dave Syer
	 *
	 */
	public enum Level {

		/**
		 * Key for {@link Classifier} signalling that the throwable should be rethrown. If
		 * the throwable is not a RuntimeException it is wrapped in a
		 * {@link RepeatException}.
		 */
		RETHROW,

		/**
		 * Key for {@link Classifier} signalling that the throwable should be logged at
		 * debug level.
		 */
		DEBUG,

		/**
		 * Key for {@link Classifier} signalling that the throwable should be logged at
		 * warn level.
		 */
		WARN,

		/**
		 * Key for {@link Classifier} signalling that the throwable should be logged at
		 * error level.
		 */
		ERROR

	}

	protected final Log logger = LogFactory.getLog(LogOrRethrowExceptionHandler.class);

	private Classifier<Throwable, Level> exceptionClassifier = new ClassifierSupport<>(Level.RETHROW);

	/**
	 * Setter for the {@link Classifier} used by this handler. The default is to map all
	 * throwable instances to {@link Level#RETHROW}.
	 * @param exceptionClassifier the ExceptionClassifier to use
	 */
	public void setExceptionClassifier(Classifier<Throwable, Level> exceptionClassifier) {
		this.exceptionClassifier = exceptionClassifier;
	}

	/**
	 * Classify the throwables and decide whether to rethrow based on the result. The
	 * context is not used.
	 * @throws Throwable thrown if
	 * {@link LogOrRethrowExceptionHandler#exceptionClassifier} is classified as
	 * {@link Level#RETHROW}.
	 *
	 * @see ExceptionHandler#handleException(RepeatContext, Throwable)
	 */
	@Override
	public void handleException(RepeatContext context, Throwable throwable) throws Throwable {<FILL_FUNCTION_BODY>}

}


		Level key = exceptionClassifier.classify(throwable);
		if (Level.ERROR.equals(key)) {
			logger.error("Exception encountered in batch repeat.", throwable);
		}
		else if (Level.WARN.equals(key)) {
			logger.warn("Exception encountered in batch repeat.", throwable);
		}
		else if (Level.DEBUG.equals(key) && logger.isDebugEnabled()) {
			logger.debug("Exception encountered in batch repeat.", throwable);
		}
		else if (Level.RETHROW.equals(key)) {
			throw throwable;
		}

	
<no_super_class>