basilisp.stacktrace¶
Utility functions for printing stack traces.
- fn (context exc)[source]¶
- fn (context exc suppress-context?)
Return any context exception to the exception
exc
.Context exceptions may be the same as cause exceptions. Typically, when throwing an exception with an explicit cause the context exception is suppressed (via
BaseException.__suppress_context__
). If called with one argument, this function will use the value of__suppress_context__
forsuppress-context?
. If called with two arguments, the caller can specify if context should be returned or suppressed.
- fn (e)[source]¶
REPL utility for printing the root cause (via
root-cause
) of*e
if an exception is bound.
- fn (print-cause-trace exc)[source]¶
- fn (print-cause-trace exc n)
Prints up to
n
stack frames from the traceback of the exceptionexc
, including chained exceptions (causes and context exceptions).To print only the trace for the given exception, use
print-stack-trace
.If
n
is not given, return all frames.
- fn (print-stack-trace exc)[source]¶
- fn (print-stack-trace exc n)
Prints up to
n
stack frames from the traceback of the exceptionexc
, not including chained exceptions (causes and context exceptions).To print exception tracebacks including causes, use
print-cause-trace
.If
n
is not given, return all frames.