Monday, August 27, 2018

java - How can I convert a stack trace to a string?



What is the easiest way to convert the result of Throwable.getStackTrace() to a string that depicts the stacktrace?



Answer



One can use the following method to convert an Exception stack trace to String. This class is available in Apache commons-lang which is most common dependent library with many popular open sources



org.apache.commons.lang.exception.ExceptionUtils.getStackTrace(Throwable)


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...