MCPcopy
hub / github.com/cortexlabs/cortex / ErrorInvalidStr

Function ErrorInvalidStr

pkg/lib/configreader/errors.go:258–264  ·  view source on GitHub ↗
(provided string, allowed string, allowedVals ...string)

Source from the content-addressed store, hash-verified

256}
257
258func ErrorInvalidStr(provided string, allowed string, allowedVals ...string) error {
259 allAllowedVals := append([]string{allowed}, allowedVals...)
260 return errors.WithStack(&errors.Error{
261 Kind: ErrInvalidStr,
262 Message: fmt.Sprintf("invalid value (got %s, must be %s)", s.UserStr(provided), s.UserStrsOr(allAllowedVals)),
263 })
264}
265
266func ErrorDisallowedValue(provided interface{}) error {
267 return errors.WithStack(&errors.Error{

Callers 4

BoolFromStrFunction · 0.85
validateInterfaceMapFunction · 0.85
ValidateStringValFunction · 0.85
BoolPtrFromStrFunction · 0.85

Calls 2

WithStackFunction · 0.92
UserStrMethod · 0.45

Tested by

no test coverage detected