New creates and returns an error which is formatted from given text.
(text string)
| 12 | |
| 13 | // New creates and returns an error which is formatted from given text. |
| 14 | func New(text string) error { |
| 15 | return &Error{ |
| 16 | stack: callers(), |
| 17 | text: text, |
| 18 | code: gcode.CodeNil, |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | // Newf returns an error that formats as the given format and args. |
| 23 | func Newf(format string, args ...any) error { |