errors

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package errors provides a small, standard-library-compatible error wrapping package used internally by dque.

The New, Wrap and Wrapf functions each capture a stack trace at the call site. The stack trace is rendered only with the %%+v format verb (via fmt.Formatter); Error() returns only the message (or message chain), matching the behavior of github.com/pkg/errors. Prefer errors.Is and errors.As for inspection over string comparison.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is

func Is(err error, target error) bool

Is delegates to the standard library errors.Is.

func Join

func Join(errs ...error) error

Join returns an error that wraps the given errors. Any nil error values are discarded. Join returns nil if every value in errs is nil. The error formats as the concatenation of the strings obtained by calling the Error method of each element, with a newline between them.

func New

func New(msg string) error

New returns a new error with the given message. It captures a stack trace that is rendered with %%+v (via fmt.Formatter), matching the behavior of github.com/pkg/errors.

func Wrap

func Wrap(err error, msg string) error

Wrap returns a new error that wraps the given error with the given message. If err is nil, Wrap returns nil. The returned error captures a stack trace that is rendered with %+v.

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Wrapf returns a new error that wraps the given error with a formatted message. If err is nil, Wrapf returns nil. The returned error captures a stack trace that is rendered with %+v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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