Documentation ¶
Index ¶
- func ColorBrackets(label string, value string) string
- func ColorCode(code int) string
- func Errorf(format string, a ...any) *wrapError
- func ExtractErrorDetail(err error) string
- func FileNameOfPath(path string) string
- func FormatCaller(pkg, path string, number int) string
- func FormatCallerFromFrame(frm Frame) string
- func FormatErrorCaller(err error, name string, verbose bool) string
- func FormatJsonForDetail(b []byte, ignored []string, priority []string) (string, error)
- func FullChainFormatter(kid error) string
- func GetChain(err error) []error
- func GetDeepest(err error) error
- func GetDeepestTerror(err error) *wrapError
- func GetPackageAndFuncFromFuncName(pc string) (pkg, function string)
- func InlineChainFormatter(self func() string, kid error) string
- func Into[T error](err error) (val T, ok bool)
- func Mismatch[T any](expected, actual T) *wrapError
- func New(text string) *wrapError
- func Wrap(err error, message string) *wrapError
- func WrapWithCaller(err error, message string, frm int) *wrapError
- func Wrapf(err error, format string, a ...interface{}) *wrapError
- func ZeroLogCallerMarshalFunc(pc uintptr, file string, line int) string
- type Frame
- type Framer
- type Recovery
- type RecoveryInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorBrackets ¶ added in v0.7.0
func Errorf ¶ added in v0.4.0
Errorf formats according to a format specifier and returns the string as a value that satisfies error.
The returned error contains a Frame set to the caller's location and implements Formatter to show this information when printed with details.
func ExtractErrorDetail ¶ added in v0.7.0
func FileNameOfPath ¶ added in v0.7.0
func FormatCaller ¶
func FormatCallerFromFrame ¶ added in v0.7.0
func FormatJsonForDetail ¶ added in v0.7.0
func FullChainFormatter ¶ added in v0.12.0
func GetDeepest ¶ added in v0.19.0
func GetDeepestTerror ¶ added in v0.19.0
func GetDeepestTerror(err error) *wrapError
func GetPackageAndFuncFromFuncName ¶ added in v0.7.0
func InlineChainFormatter ¶ added in v0.12.0
func Into ¶ added in v0.7.0
Into finds the first error in err's chain that matches target type T, and if so, returns it.
Into is type-safe alternative to As.
func New ¶
func New(text string) *wrapError
New returns an error that formats as the given text.
The returned error contains a Frame set to the caller's location and implements Formatter to show this information when printed with details.
func WrapWithCaller ¶ added in v0.3.0
Types ¶
type Frame ¶ added in v0.4.0
type Frame struct {
// contains filtered or unexported fields
}
A Frame contains part of a call stack.
type Framer ¶
func FirstCause ¶ added in v0.7.0
type RecoveryInfo ¶ added in v0.18.0
func IsRecoverable ¶ added in v0.13.0
func IsRecoverable(err error) (bool, *RecoveryInfo)
Click to show internal directories.
Click to hide internal directories.