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)
| 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. |
| 22 | func 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. |
| 27 | func Convert01[T1 any](t1 T1, err error) (T1, Error) { |