xerrors

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package xerrors contains extensions to the standard library package errors.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithStack

func WithStack(err error) error

WithStack returns an error that wraps err and adds the call stack of the call to WithStack to Error(). If err is nil or already has a stack attached, returns err.

Example
err := WithStack(errors.New("foo"))

fmt.Println(strings.Join(strings.Split(err.Error(), "\n")[:3], "\n"))
Output:


foo

github.com/bradenaw/juniper/xerrors.ExampleWithStack(...)

Types

This section is empty.

Jump to

Keyboard shortcuts

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