Skip to content

Commit

Permalink
Update xerror_api.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mooncake9527 committed Dec 4, 2024
1 parent 5b98e05 commit 4bb0804
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xerrors/xerror/xerror_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ func New(text string) error {
code: xcode.CodeNil,
}
}
func NewC(code int,text string) error {
return &Error{
stack: callers(),
text: text,
code: xcode.CodeNil,
}
}

// Newf 用于创建一个自定义文本错误带参数信息的 error 对象,并包含堆栈信息。
func Newf(format string, args ...any) error {
Expand Down

0 comments on commit 4bb0804

Please sign in to comment.