Get A String Version Of A Stacktrace
Join the DZone community and get the full member experience.Join For Free
// Get a String version of a stacktrace
Throwable t = new Throwable(); // test code final Writer result = new StringWriter(); final PrintWriter printWriter = new PrintWriter(result); t.printStackTrace(printWriter); result.toString();
Strings Data Types
Opinions expressed by DZone contributors are their own.