/** * Gets the holded exception stacktrace using {@link Exception#printStackTrace()}. * * @return stacktrace */ public String getExceptionStack() { String exceptionStack = null; if (getException() != null) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { getException().printStackTrace(pw); exceptionStack = sw.toString(); } finally { try { sw.close(); pw.close(); } catch (IOException e) { // ignore } } } return exceptionStack; }