diagnosticerror

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package diagnosticerror freezes bounded error evidence without retaining errors.

Index

Constants

View Source
const (
	MaxNodes           = 16
	MaxDepth           = 8
	MaxFrames          = 12
	MaxMessageBytes    = 1024
	MaxTypeBytes       = 256
	MaxSourceBytes     = 256
	MaxFrameFieldBytes = 256
	MaxErrorTextBytes  = 6144
	MaxStackTextBytes  = 2048
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	Function string
	File     string
	Line     int
}

Frame is a capture location, not a claim about where an error was created.

type Node

type Node struct {
	Parent           int
	Type             string
	Message          string
	Truncated        bool
	InspectionFailed bool
}

Node uses a parent index to retain every branch of errors.Join without a recursive wire shape. The root's parent is -1.

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

Snapshot exposes copies of its collections so observer queues never share mutable error objects or mutable backing arrays with their consumers.

func Capture

func Capture(err error, source string) Snapshot

Capture records the call site and snapshots standard single- and multi-cause errors. A nil error still records the source and stack, with no error nodes.

func (Snapshot) CaptureStack

func (snapshot Snapshot) CaptureStack() []Frame

func (Snapshot) Nodes

func (snapshot Snapshot) Nodes() []Node

func (Snapshot) Present

func (snapshot Snapshot) Present() bool

func (Snapshot) Source

func (snapshot Snapshot) Source() string

func (Snapshot) Truncated

func (snapshot Snapshot) Truncated() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL