MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / New

Function New

internal/errors/error.go:28–41  ·  view source on GitHub ↗

New 新错误

(errText string)

Source from the content-addressed store, hash-verified

26
27// New 新错误
28func New(errText string) error {
29 ptr, file, line, ok := runtime.Caller(1)
30 funcName := ""
31 if ok {
32 frame, _ := runtime.CallersFrames([]uintptr{ptr}).Next()
33 funcName = filepath.Base(frame.Function)
34 }
35 return &errorObj{
36 err: errors.New(errText),
37 file: file,
38 line: line,
39 funcName: funcName,
40 }
41}
42
43// Wrap 包装已有错误
44func Wrap(err error) error {

Callers 4

cacheStorageMethod · 0.92
ConvertWAFMethod · 0.92
TestNewFunction · 0.70
testError1Function · 0.70

Calls 1

NextMethod · 0.80

Tested by 2

TestNewFunction · 0.56
testError1Function · 0.56