stack trace

The list of function calls that were running when an error happened, printed to help a developer find where it came from; Python calls it a traceback.

In more detail

It is the first thing to read when a program crashes: it shows where the error was raised and the path of calls that led there. Different languages print the calls in different orders. Because it reveals file paths, library versions and sometimes data, record it in protected logs and send callers only a safe error message.

Examples

In the APIs course: The course leaky five hundred fault puts one into the error body.
Go: an unrecovered panic prints a stack trace for each goroutine to standard error
A stack trace must never be a metric label value: it is unbounded and would create a new time series for every variant.
In Python the stack trace is called a traceback and reads oldest call first.
React also provides a component stack, listing the components that were rendering, which is often more useful for UI errors.
In this course: Python calls it a traceback. Reading from the test into the code under test and on into a collaborator shows exactly which boundary the failure crossed. pytest can shorten or hide it with the --tb option when you only need the summary.

Related terms

Taught in

References

Certification courses