diagnostics

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(parseReport Report)

Emit writes the formatted report to stderr.

func WriteHTTPError

func WriteHTTPError(parseW http.ResponseWriter, parseStatus int, parseReport Report)

WriteHTTPError emits the report and writes it as a plain-text HTTP error response.

This lives behind !js so browser/wasm builds never link net/http: that import chain (http → crypto/tls → x509 → dnsmessage) costs roughly a megabyte of wasm for a helper only servers can call.

Types

type Options

type Options struct {
	Summary       string
	Code          string
	Headline      string
	Path          string
	Runtime       string
	Next          string
	Docs          string
	SkipFunctions []string
}

type Report

type Report struct {
	Summary         string
	Code            string
	Headline        string
	Where           string
	Path            string
	Error           string
	Runtime         string
	Next            string
	Docs            string
	AppFrames       []string
	FrameworkFrames []string
	PlatformFrames  []string
}

func Build

func Build(parseOptions Options) Report

Build constructs a Report from the given Options, capturing and classifying a stack trace.

func (Report) Formatted

func (parseReport Report) Formatted() string

Jump to

Keyboard shortcuts

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