MCPcopy
hub / github.com/larksuite/cli / wrapDocInputFileErr

Function wrapDocInputFileErr

shortcuts/doc/doc_errors.go:27–34  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
27func 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}

Callers 4

readDocCoverUpdateSourceFunction · 0.85
TestWrapDocInputFileErrFunction · 0.85

Calls 2

WrapInputStatErrorTypedFunction · 0.92
AsMethod · 0.80

Tested by 1

TestWrapDocInputFileErrFunction · 0.68