sh icon indicating copy to clipboard operation
sh copied to clipboard

all: consider changes for error wrapping

Open mvdan opened this issue 3 years ago • 0 comments

Error wrapping came with Go 1.13, so we're a bit late to adapt to it. At least, we should allow the user to unwrap internal errors from the errors returned by the parser or interpreter.

We also have thewe two APIs that should probably be deprecated in favor of something more idiomatic given error wrapping:

interp/api.go:479:func IsExitStatus(err error) (status uint8, ok bool) {
syntax/parser.go:753:func IsIncomplete(err error) bool {

For example, the latter should probably be errors.Is(err, io.ErrUnexpectedEOF) instead.

mvdan avatar Sep 29 '21 13:09 mvdan