wrapDocInputFileErr wraps a --file Stat/read failure via the shared typed helper (which sets the cause) and tags it with the --file param so agents learn which flag to fix. The common helper is flag-agnostic, so the param is attached here at the Doc call site rather than mutating shared behavior.
(err error, readMsg string)
| 25 | // learn which flag to fix. The common helper is flag-agnostic, so the param is |
| 26 | // attached here at the Doc call site rather than mutating shared behavior. |
| 27 | func wrapDocInputFileErr(err error, readMsg string) error { |
| 28 | wrapped := common.WrapInputStatErrorTyped(err, readMsg) |
| 29 | var ve *errs.ValidationError |
| 30 | if errors.As(wrapped, &ve) { |
| 31 | ve.Param = "--file" |
| 32 | } |
| 33 | return wrapped |
| 34 | } |