Returns the Java backtrace of a throwable
.
lw-ji
get-throwable-backtrace-strings throwable-jobject => backtrace-list
throwable-jobject⇩ |
A jobject or an instance of standard-java-object. |
backtrace-list⇩ |
A list of Lisp strings. |
The function get-throwable-backtrace-strings
returns a list of strings containing a Java backtrace based on the information in throwable-jobject, which is typically an exception thrown by some Java method. If throwable-jobject contains a cause (that is the Java method getCause
returns non-null), then get-throwable-backtrace-strings
recurses to generate a backtrace for the cause as well.
throwable-jobject must be either a jobject of Java class throwable
or an instance of standard-java-object associated with such jobject.
The result backtrace-list is a list of strings, each string representing a StackTraceElement
in the stack trace of throwable-jobject. Recursive backtraces are preceded by a string saying "CAUSED BY:".
Note that if you have a java-exception object, then it already contains the backtrace which can be accessed by java-exception-java-backtrace. You need get-throwable-backtrace-strings
only when you deal with throwable
objects directly.
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:46