
package com.exedio.cope.lib;

import java.io.PrintStream;
import java.io.PrintWriter;

/**
 * Is thrown, when a fatal unspecified error occurs.
 */
public final class SystemException extends RuntimeException
{
	private final Exception cause;
	private final String message;
	
	public SystemException(final Exception cause)
	{
		this.cause = cause;
		this.message = null;
	}
	
	public SystemException(final Exception cause, final String message)
	{
		this.cause = cause;
		this.message = message;
	}
	
	public void printStackTrace()
	{
		super.printStackTrace();
		if(message!=null)
			System.out.println(message);
		cause.printStackTrace();
	}

	public void printStackTrace(final PrintStream s)
	{
		super.printStackTrace(s);
		if(message!=null)
			s.println(message);
		cause.printStackTrace(s);
	}

	public void printStackTrace(final PrintWriter s)
	{
		super.printStackTrace(s);
		if(message!=null)
			s.println(message);
		cause.printStackTrace(s);
	}

}

@@ -490,24 +490,270 @@
 ssage;%0A%09%7D%0A%09%0A
+%09public String getMessage()%0A%09%7B%0A%09%09if(message!=null)%0A%09%09%7B%0A%09%09%09if(cause!=null)%0A%09%09%09%09return message + %22:%22 + cause.getMessage();%0A%09%09%09else%0A%09%09%09%09return message;%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09if(cause!=null)%0A%09%09%09%09return cause.getMessage();%0A%09%09%09else%0A%09%09%09%09return %22%22;%0A%09%09%7D%0A%09%7D%0A%09%0A
 %09public void

better produce messages