(ctx context.Context, command string, err error)
| 146 | } |
| 147 | |
| 148 | func HandleError(ctx context.Context, command string, err error) error { |
| 149 | if err == nil { |
| 150 | return interp.NewExitStatus(0) |
| 151 | } |
| 152 | |
| 153 | _, ok := interp.IsExitStatus(err) |
| 154 | if ok { |
| 155 | return err |
| 156 | } |
| 157 | |
| 158 | hc := interp.HandlerCtx(ctx) |
| 159 | _, _ = fmt.Fprintln(hc.Stderr, errors.Wrap(err, command)) |
| 160 | return interp.NewExitStatus(1) |
| 161 | } |
| 162 | |
| 163 | var lookPathDir = interp.LookPathDir |
no outgoing calls
no test coverage detected