errorutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithDetails

func WithDetails(base error, details ...interface{}) error

WithDetails returns an error wrapping err, appended with a string representation of details separated by ": ".

Example

var ErrNotFound = errors.New("not found")
err := WithDetails(ErrNotFound, "abc.jpg", "deleted yesterday")

errors.Is(err, ErrNotFound) == true
err.Error() == "not found: abc.jpg: deleted yesterday"

Types

This section is empty.

Jump to

Keyboard shortcuts

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