error

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 1 Imported by: 2

README

The errors package defines interfaces for error types that manage wrapping errors with additional context or data. This allows for troubleshooting and error handling comparable to traditional exception management.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caller

type Caller interface {
	// Caller returns the associated Caller instance.
	Caller() caller.Caller
}

Caller is the interface implemented by error types that can expose runtime caller data.

type Error

type Error interface {
	// Error implements error.
	Error() string

	// Is tests to see if the test error matches any error in the stack via
	// equality comparison.
	Is(error) bool

	// Unwrap returns the wrapped error, if any, otherwise nil.
	Unwrap() error
}

Error defines a robust error stack interface.

type Wrapper added in v2.1.0

type Wrapper interface {
	// Unwrap returns the next error in the error stack, if any, otherwise
	// nil.
	Unwrap() error
}

Wrapper is an interface implemented by error types that have wrapped a previous error.

Jump to

Keyboard shortcuts

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