package de.uka.ipd.sdq.beagle.core;

/**
 * {@linkplain FailureHandler} throwing an exception for any reported failure.
 *
 * @author Joshua Gleitze
 */
public class ExceptionThrowingFailureHandler extends FailureHandler {

	/**
	 * The reporter’s name.
	 */
	private final String clientName;

	/**
	 * Create a handler for a client called {@code clientName}.
	 *
	 * @param clientName Name identifying the client that may report failures through this
	 *            handler.
	 */
	public ExceptionThrowingFailureHandler(final String clientName) {
		this.clientName = clientName;
	}

	@Override
	public <RECOVER_TYPE> RECOVER_TYPE handle(final FailureReport<RECOVER_TYPE> report) {
		String failureDescription = String.format("%s reported a failure!", this.clientName);
		if (report.getFailureCause() == null && report.getFailureMessage() != null) {
			failureDescription += "\n\n" + report.getFailureMessage();
		}
		throw new RuntimeException(failureDescription, report.getFailureCause());
	}

}

@@ -909,16 +909,122 @@
 ();%0A%09%09%7D%0A
+%09%09if (report.getDetails() != null) %7B%0A%09%09%09failureDescription += %22%5Cn%5CnDetails:%5Cn%22 + report.getDetails();%0A%09%09%7D%0A
 %09%09throw 

Print the failure’s details in ExceptionThrowingFailureHandler