NewTextError creates a new [TextError] with the given message and options.
(msg string, stackSkip int, opts ...Option)
| 12 | |
| 13 | // NewTextError creates a new [TextError] with the given message and options. |
| 14 | func NewTextError(msg string, stackSkip int, opts ...Option) *TextError { |
| 15 | return &TextError{ |
| 16 | msg: msg, |
| 17 | ErrorContext: newErrorContext(stackSkip+1, opts...), |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | // Error returns the error message with prefix if set. |
| 22 | func (e *TextError) Error() string { |