package
0.8.9
Repository: https://github.com/influx6/npkg.git
Documentation: pkg.go.dev

# README

Errors

Errors provides a package for wrapping go based nerror with location of return site.

Install

go get -v github.com/influx6/npkg/nerror

Usage

  1. Create new nerror
newBadErr = nerror.New("failed connection: %s", "10.9.1.0")
  1. Create new nerror with stacktrace
newBadErr = nerror.Stacked("failed connection: %s", "10.9.1.0")
  1. Wrap existing error
newBadErr = nerror.Wrap(BadErr, "something bad happened here")
  1. Wrap existing error with stacktrace
newBadErr = nerror.WrapStack(BadErr, "something bad happened here")
  1. Add Stack to package's error type without stack trace.
newBadErr = nerror.StackIt(BadErr)

# Functions

Apply applies giving set of ErrorOptions to provided error.
Forward wraps giving error, recording where it was created and attaches the frames of call.
Frames will attempt to add call stack into provided error if error is a PointingError type without a stack.
IsAny returns true/false any of giving error matches set of error.
No description provided by the author
Meta adds giving header map as meta information to error.
New returns an error from provided message and parameter list if provided.
NewBy returns an error from provided message and parameter list if provided.
NewStack returns a new error which wraps existing error value if present and also collects current stack trace into returned error.
Stacked returns an error from provided message and parameter list if provided.
StackedBy returns an error from provided message and parameter list if provided.
StackWrap returns a new error which wraps existing error value if present and also collects current stack trace into returned error.
Unwrap returns the underline error of giving PointingError.
UnwrapDeep returns the root error wrapped by all possible PointingError types.
Wrap returns a new error which wraps existing error value if present.
WrapBy returns a new error which wraps existing error value if present.
WrapOnly returns a new error which wraps existing error value if present.

# Structs

PointingError defines a custom error type which points to both an originating point of return and a parent error if wrapped.

# Interfaces

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

ErrorOption defines a giving function which receiving a giving error returns another modified with respect to it's internal intent.
ErrorStack allows you to stack multiple messages together which can be combined into a single error message when calling ErrorStack.Err().