Documentation
¶
Overview ¶
Package errorskratos provides type-safe helpers to handle Kratos errors, avoiding naming conflicts with the standard errors package.
errorskratos 提供 Kratos 错误的类型安全辅助函数,避免与标准 errors 包命名冲突。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func As ¶
As converts a generic error to a Kratos error and reports success.
As 把通用 error 转成 Kratos 错误,并返回是否成功。
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package erkadapt converts a Kratos error to the standard error interface with correct nil semantics, sidestepping Go's (*T)(nil) != nil trap.
|
Package erkadapt converts a Kratos error to the standard error interface with correct nil semantics, sidestepping Go's (*T)(nil) != nil trap. |
|
must
|
|
|
erkassert
Package erkassert wraps testify/assert to test Kratos errors, handling the nil interface trap via erkadapt.
|
Package erkassert wraps testify/assert to test Kratos errors, handling the nil interface trap via erkadapt. |
|
erkmust
Package erkmust panics on a non-nil Kratos error, logging it first.
|
Package erkmust panics on a non-nil Kratos error, logging it first. |
|
erkrequire
Package erkrequire wraps testify/require to test Kratos errors, handling the nil interface trap via erkadapt.
|
Package erkrequire wraps testify/require to test Kratos errors, handling the nil interface trap via erkadapt. |
Click to show internal directories.
Click to hide internal directories.