New returns an error with the supplied message. New also records the stack trace at the point it was called.
(message string)
| 100 | // New returns an error with the supplied message. |
| 101 | // New also records the stack trace at the point it was called. |
| 102 | func New(message string) error { |
| 103 | return &fundamental{ |
| 104 | msg: message, |
| 105 | stack: callers(), |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | // Errorf formats according to a format specifier and returns the string |
| 110 | // as a value that satisfies error. |