{"modulePath":"github.com/madlabx/pkgx","version":"v1.3.90","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Functions\n\n```go\nfunc As(err error, target interface{}) bool\n```\nAs finds the first error in err's chain that matches target, and if so, sets target to that error value and returns true.\n\nThe chain consists of err itself followed by the sequence of errors obtained by repeatedly calling Unwrap.\n\nAn error matches target if the error's concrete value is assignable to the value pointed to by target, or if the error has a method As(interface{}) bool such that As(target) returns true. In the latter case, the As method is responsible for setting target.\n\nAs will panic if target is not a non-nil pointer to either a type that implements error, or to any interface type. As returns false if err is nil.\n\n```go\nfunc Cause(err error) error\n```\nCause returns the underlying cause of the error, if possible. An error value has a cause if it implements the following interface:\n\n\ttype causer interface {\n\t       Cause() error\n\t}\n\nIf the error does not implement Cause, the original error will be returned. If the error is nil, nil will be returned without further investigation.\n\n```go\nfunc Errorf(format string, args ...interface{}) error\n```\nErrorf formats according to a format specifier and returns the string as a value that satisfies error. Errorf also records the stack trace at the point it was called.\n\n```go\nfunc ErrorfWithRelativeStackDepth(depth int, format string, args ...interface{}) error\n```\n\n```go\nfunc Frames(err error) []errors.Frame\n```\n\n```go\nfunc Is(err, target error) bool\n```\nIs reports whether any error in err's chain matches target.\n\nThe chain consists of err itself followed by the sequence of errors obtained by repeatedly calling Unwrap.\n\nAn error is considered to match a target if it is equal to that target or if it implements a method Is(error) bool such that Is(target) returns true.\n\n```go\nfunc Join(errs ...error) error\n```\n\n```go\nfunc New(message string) error\n```\nNew returns an error with the supplied message. New also records the stack trace at the point it was called.\n\n```go\nfunc NewStd(text string) error\n```\nNew returns an error that formats as the given text. Each call to New returns a distinct error value even if the text is identical.\n\n```go\nfunc ResetStackDepth(d int)\n```\n\n```go\nfunc StackTrace(err error) errors.StackTrace\n```\n\n```go\nfunc Unwrap(err error) error\n```\nUnwrap returns the result of calling the Unwrap method on err, if err's type contains an Unwrap method returning error. Otherwise, Unwrap returns nil.\n\n```go\nfunc WithStack(err error) error\n```\nWithStack annotates err with a stack trace at the point WithStack was called. If err is nil, WithStack returns nil.\n\n```go\nfunc Wrap(err error) error\n```\nWrap returns an error annotating err with a stack trace at the point Wrap is called. If err is nil, Wrap returns nil.\n\n```go\nfunc WrapWithRelativeStackDepth(err error, depth int) error\n```\n\n```go\nfunc Wrapf(err error, format string, args ...interface{}) error\n```\nWrapf returns an error annotating err with a stack trace at the point Wrapf is called, and the format specifier. If err is nil, Wrapf returns nil.\n\n```go\nfunc WrapfWithRelativeStackDepth(err error, depth int, format string, args ...any) error\n```\n\n## Types\n\n```go\ntype ErrorWithStackTrace interface {\n\tStackTrace() errors.StackTrace\n}\n```\n\n```go\ntype Sentinel = errors.Sentinel\n```\n\n```go\ntype WithMsgfIf interface {\n\tWithMessagef(format string, args ...any) error\n}\n```\n\n","path":"github.com/madlabx/pkgx/errors","name":"errors","synopsis":"","isRedistributable":true}
