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

Function baseValidationErrorf

shortcuts/base/base_errors.go:58–68  ·  view source on GitHub ↗
(format string, args ...any)

Source from the content-addressed store, hash-verified

56}
57
58func baseValidationErrorf(format string, args ...any) error {
59 msg := fmt.Sprintf(format, args...)
60 err := errs.NewValidationError(errs.SubtypeInvalidArgument, "%s", msg)
61 if params := flagParams(msg); len(params) > 0 {
62 err = err.WithParam(params[0].Name).WithParams(params...)
63 }
64 if cause := firstErrorArg(args); cause != nil {
65 err = err.WithCause(cause)
66 }
67 return err
68}
69
70func flagParams(msg string) []errs.InvalidParam {
71 reason := msg

Calls 6

WithParamMethod · 0.95
WithCauseMethod · 0.95
NewValidationErrorFunction · 0.92
flagParamsFunction · 0.85
firstErrorArgFunction · 0.85
WithParamsMethod · 0.80

Tested by

no test coverage detected