package
0.0.2
Repository: https://github.com/wangtaoking1/app-base.git
Documentation: pkg.go.dev

# README

基于 github.com/pkg/errors 包,增加对 error code 的支持,完全兼容 github.com/pkg/errors

性能跟 github.com/pkg/errors 基本持平。

# Functions

AggregateGoroutines runs the provided functions in parallel, stuffing all non-nil errors into the returned Aggregate.
Cause returns the underlying cause of the errors, if possible.
CreateAggregateFromMessageCountMap converts MessageCountMap Aggregate.
Errorf formats according to a format specifier and returns the string as a value that satisfies errors.
FilterOut removes all errors that match any of the matchers from the input error.
Flatten takes an Aggregate, which may hold other Aggregates in arbitrary nesting, and flattens them all into a single Aggregate, recursively.
IsCode reports whether any error in err's chain contains the given error code.
MustRegister register a user define error code.
New returns an errors with the supplied message.
NewAggregate converts a slice of errors into an Aggregate interface, which is itself an implementation of the error interface.
ParseCoder parse any error into *withCode.
Reduce will return err or, if err is an Aggregate and only has one item, the first item in the aggregate.
Register registers a user define error code.
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.
Wrap returns an errors annotating err with a stack trace at the point Wrap is called, and the supplied message.
No description provided by the author
Wrapf returns an errors annotating err with a stack trace at the point Wrapf is called, and the format specifier.

# Variables

ErrPreconditionViolated is returned when the precondition is violated.

# Interfaces

Aggregate represents an object that contains multiple errors, but does not necessarily have singular semantic meaning.
Coder defines an interface for an error code detail information.

# Type aliases

Frame represents a program counter inside a stack frame.
Matcher is used to match errors.
MessageCountMap contains occurrence for each error message.
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).