Expand description
Stack traces from Rust, Python, Java and JavaScript, in one shape.
parse recognises a trace’s language and normalises it into a
StackTrace: the error kind and message, its Frames ordered with the
most recent call last (Python’s order), and any chained cause. Each
language is a TraceParser; Parsers holds the built-in four and
takes more, so other formats plug in without changing this module.
A StackTrace renders with frame locations linked through a
Hyperlinker, library frames dimmed and runs of them collapsed, and each
cause after the trace it caused. capture and panic_hook build one
for the current thread from std::backtrace.
Structs§
- Frame
- One stack frame.
- Java
Parser - Parses JVM stack traces with
Caused by:chains. - Java
Script Parser - Parses V8 (
node, Chrome) stack traces. - Parsers
- An ordered set of parsers; the first that detects a trace parses it.
- Python
Parser - Parses CPython tracebacks, including chained exceptions.
- Rust
Parser - Parses
std::backtraceoutput and panic messages. - Stack
Trace - A normalised stack trace.
- Stack
Trace View - Rendering options for a
StackTrace.
Enums§
- Cause
Kind - How a trace relates to its
StackTrace::cause. - Language
- The language a trace came from.
Constants§
- MAX_
CAUSES - The most causes the built-in parsers keep, and a view renders, below the outermost error. Traces are untrusted input; a longer chain keeps the causes nearest the error and records how many were left out.
Traits§
- Trace
Parser - Recognises and parses one trace format.
Functions§
- capture
- The current thread’s backtrace as a Rust
StackTracewithmessage. Frames come fromstd::backtrace::Backtrace::force_capture, so they need debug info to carry file locations. - panic_
hook - A panic hook printing the panic as a
StackTracetoconsole. Install it withstd::panic::set_hook(Box::new(panic_hook(console))); this module never installs anything itself. - parse
- Parse
textwith the built-in parsers.