Send a backtrace of the current error to stream. Stream is assumed to be an open writable file stream or a string-output-stream. Note that print-backtrace-to-streamwill print a backtrace for whatever the Lisp deems to be the current error.
print-backtrace-to-stream