Documentation
¶
Index ¶
- func NewCode(code int) *codeDefault
- func NewException(code int, message string, fields ...gox.Field[any]) *exceptionDefault
- func NewField(message string, field gox.Field[any]) *fieldDefault
- func NewFields(message string, fields ...gox.Field[any]) *fieldsDefault
- func NewMessage(message string) *messageDefault
- type Code
- type Exception
- type Field
- type Fields
- type MessageException
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewException ¶
NewException 创建异常
Types ¶
type Field ¶
type Field interface {
error
MessageException
// Field 返回错误实体
// 在某些错误下,可能需要返回额外的信息给前端处理
// 比如,认证错误,需要返回哪些字段有错误
Field() gox.Field[any]
}
Field 带字段的异常
type Fields ¶
type Fields interface {
error
MessageException
// Fields 返回错误实体
// 在某些错误下,可能需要返回额外的信息给前端处理
// 比如,认证错误,需要返回哪些字段有错误
Fields() gox.Fields[any]
}
Fields 带多个字段列表的异常
type MessageException ¶
MessageException 带消息的异常
Click to show internal directories.
Click to hide internal directories.

