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

Function Wrap

internal/errors/error.go:44–61  ·  view source on GitHub ↗

Wrap 包装已有错误

(err error)

Source from the content-addressed store, hash-verified

42
43// Wrap 包装已有错误
44func Wrap(err error) error {
45 if err == nil {
46 return nil
47 }
48
49 ptr, file, line, ok := runtime.Caller(1)
50 funcName := ""
51 if ok {
52 frame, _ := runtime.CallersFrames([]uintptr{ptr}).Next()
53 funcName = filepath.Base(frame.Function)
54 }
55 return &errorObj{
56 err: err,
57 file: file,
58 line: line,
59 funcName: funcName,
60 }
61}

Callers 4

loopMethod · 0.92
TestNewFunction · 0.85
testError2Function · 0.85

Calls 1

NextMethod · 0.80

Tested by 2

TestNewFunction · 0.68
testError2Function · 0.68