WrapCode wraps error with code and text. It returns nil if given err is nil.
(code gcode.Code, err error, text ...string)
| 55 | // WrapCode wraps error with code and text. |
| 56 | // It returns nil if given err is nil. |
| 57 | func WrapCode(code gcode.Code, err error, text ...string) error { |
| 58 | if err == nil { |
| 59 | return nil |
| 60 | } |
| 61 | return &Error{ |
| 62 | error: err, |
| 63 | stack: callers(), |
| 64 | text: strings.Join(text, commaSeparatorSpace), |
| 65 | code: code, |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // WrapCodef wraps error with code and format specifier. |
| 70 | // It returns nil if given `err` is nil. |
searching dependent graphs…