(source error)
| 14 | } |
| 15 | |
| 16 | func NewExecError(source error) error { |
| 17 | if source == nil { |
| 18 | return nil |
| 19 | } |
| 20 | |
| 21 | // BUG(gcurtis): exec.Cmd.Run can return other error types, such as when the |
| 22 | // binary path isn't found. Those should still be considered a user exec error |
| 23 | // and not reported to Sentry. |
| 24 | var exitErr *exec.ExitError |
| 25 | if !errors.As(source, &exitErr) { |
| 26 | return source |
| 27 | } |
| 28 | return &ExitError{ExitError: exitErr} |
| 29 | } |