MCPcopy
hub / github.com/apache/devlake / Convert

Function Convert

backend/core/errors/converter.go:22–24  ·  view source on GitHub ↗

Convert converts a raw error to an Error. Similar to Type.WrapRaw with a type of Default, but will not wrap the error if it's already of type Error. Passing in nil will return nil.

(err error)

Source from the content-addressed store, hash-verified

20// Convert converts a raw error to an Error. Similar to Type.WrapRaw with a type of Default, but will not wrap the error if it's already of type Error.
21// Passing in nil will return nil.
22func Convert(err error) Error {
23 return Default.wrapRaw(err, false, withStackOffset(1))
24}
25
26// Convert01 an extension of Convert that allows passing in one extra arg. Useful for inlining the conversion of multivalued returns.
27func Convert01[T1 any](t1 T1, err error) (T1, Error) {

Callers 2

TestCrdbErrorImplFunction · 0.70
TestIsFunction · 0.70

Calls 2

withStackOffsetFunction · 0.85
wrapRawMethod · 0.80

Tested by 2

TestCrdbErrorImplFunction · 0.56
TestIsFunction · 0.56