MCPcopy Index your code
hub / github.com/cortexlabs/cortex / ErrorInvalidInt

Function ErrorInvalidInt

pkg/lib/configreader/errors.go:250–256  ·  view source on GitHub ↗
(provided int, allowed int, allowedVals ...int)

Source from the content-addressed store, hash-verified

248}
249
250func ErrorInvalidInt(provided int, allowed int, allowedVals ...int) error {
251 allAllowedVals := append([]int{allowed}, allowedVals...)
252 return errors.WithStack(&errors.Error{
253 Kind: ErrInvalidInt,
254 Message: fmt.Sprintf("invalid value (got %s, must be %s)", s.UserStr(provided), s.UserStrsOr(allAllowedVals)),
255 })
256}
257
258func ErrorInvalidStr(provided string, allowed string, allowedVals ...string) error {
259 allAllowedVals := append([]string{allowed}, allowedVals...)

Callers 1

ValidateIntValFunction · 0.85

Calls 2

WithStackFunction · 0.92
UserStrMethod · 0.45

Tested by

no test coverage detected