MCPcopy
hub / github.com/lindb/lindb / Error

Function Error

pkg/error/error.go:23–32  ·  view source on GitHub ↗

Error returns error based on given err interface.

(err interface{})

Source from the content-addressed store, hash-verified

21
22// Error returns error based on given err interface.
23func Error(err interface{}) error {
24 switch t := err.(type) {
25 case string:
26 return errors.New(t)
27 case error:
28 return t
29 default:
30 return errors.New("unknown error")
31 }
32}

Callers 1

TestErrorFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestErrorFunction · 0.68