Categorygithub.com/Laisky/errors/v2
modulepackage
2.0.1
Repository: https://github.com/laisky/errors.git
Documentation: pkg.go.dev

# README

Errors with stack info

VersionSupport Go
v1>= 1.13
v2>= 1.20

New Features

v2

  1. Join
  2. Is
  3. UnWrap
  4. ErrorfWithSkip

v1

  1. SetSkipCallers: set global depth to skip callers
  2. WrapWithSkip:
  3. WrapfWithSkip:

Set global depth to skip callers

import "github.com/Laisky/errors/v2"

errors.SetSkipCallers(3)  // default to 3

# Functions

As finds the first error in err's tree that matches target, and if one is found, sets target to that error value and returns true.
Cause returns the underlying cause of the error, if possible.
Errorf formats according to a format specifier and returns the string as a value that satisfies error.
ErrorfWithStack same as Errorf, but you can skip arbitrary stacks.
GetSkipCallers get depth of skip callers.
Is reports whether any error in err's tree matches target.
Join returns an error that wraps the given errors.
New returns an error with the supplied message.
SetSkipCallers set depth of skip callers.
No description provided by the author
WithMessage annotates err with a new message.
WithMessagef annotates err with the format specifier.
WithStack annotates err with a stack trace at the point WithStack was called.
WithStackWithSkip like WithStackm but you can skip arbitrary stacks.
Wrap returns an error annotating err with a stack trace at the point Wrap is called, and the supplied message.
Wrapf returns an error annotating err with a stack trace at the point Wrapf is called, and the format specifier.
WrapfWithSkip same as Wrapf, but you can skip arbitrary stacks.
WrapWithSkip same as Wrap, but you can skip arbitrary stacks.

# Type aliases

Frame represents a program counter inside a stack frame.
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).