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__ for suppress-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 exception exc, 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 exception exc, 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.

fn (print-throwable exc)[source]

Print the type and message of exception exc.

Prints the ex-data map if present.

fn (root-cause exc)[source]

Return the root cause exception of the possible chain of exceptions exc.