Mistři v programování na #hovnokod

Java #4230

{
	...
} catch (Exception e) {
	throw new MySystemException(MyException.getStackTrace(e));
}

public static String getStackTrace(Throwable theCausedByException) {
	String myStackTrace = null;

	if (theCausedByException != null) {
		ByteArrayOutputStream myOutputStream = new ByteArrayOutputStream();
		PrintStream myPrintStream = new PrintStream(myOutputStream);
		theCausedByException.printStackTrace(myPrintStream);
		myStackTrace = myOutputStream.toString();
	}

	return myStackTrace;
}

Deii David Vana,