errx

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 2 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	New  = eris.New
	Newf = eris.Errorf

	Wrap  = eris.Wrap
	Wrapf = eris.Wrapf

	Unwrap = eris.Unwrap
	Cause  = eris.Cause

	Join = errors.Join

	Is = errors.Is
	As = errors.As
)

New、Newf、Wrap、Wrapf、Unwrap 和 Cause 是 eris 对应函数的别名。 Join、Is 和 As 是标准库 errors 对应函数的别名,Is 和 As 可匹配 Join 产生的多错误链。

View Source
var Nil = New("Nil")

Nil 是一个哨兵错误,用于在没有实际错误但需要非空错误值时占位。

Functions

func AsType

func AsType[E error](err error) (E, bool)

AsType 是标准库 errors.AsType 的入口,通过类型参数提取错误链中指定类型的错误。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL