diagnostics

package
v1.5.0-rc-2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 2 modules, 2 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Err

type Err struct {
	Orig error

	// Source defines with entity is generating the error.
	// It allows passing along information about where the error is being
	// generated from. for example, the Asset.
	Source string

	// Reason is a CamelCase string that summarizes the error in one word.
	// It allows easy catgeorizations of known errors.
	Reason string

	// Message is free-form strings which provides important details or
	// diagnostics for the error. When writing messages, make sure to keep in mind
	// that the audience for message is end-users who might not be experts.
	Message string
}

Err wraps diagnostics information for an error. Err allows providing information like source, reason and message that provides a much better user error reporting capability.

func (*Err) Error

func (e *Err) Error() string

Error returns a string representation of the Err. The returned value is expected to be a single value. The format of the error string returned is, `error(<Reason>) from <Source>: <Message>: <Cause of Orig>`

func (*Err) Print

func (e *Err) Print(w io.Writer)

Print prints the Err to Writer in a way that is more verbose and sectionalized. The output looks like: Error from <Source>: Reason: <reason>

Message: <Message>

Original: <Orig>

func (*Err) Unwrap

func (e *Err) Unwrap() error

Unwrap allows the error to be unwrapped.

Jump to

Keyboard shortcuts

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