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

Function ErrorMustBeDefined

pkg/lib/configreader/errors.go:397–407  ·  view source on GitHub ↗
(validValues ...interface{})

Source from the content-addressed store, hash-verified

395}
396
397func ErrorMustBeDefined(validValues ...interface{}) error {
398 msg := "must be defined"
399 if len(validValues) > 0 && !reflect.ValueOf(validValues[0]).IsNil() { // reflect is necessary here
400 msg = fmt.Sprintf("must be defined, and set to %s", s.UserStrsOr(validValues))
401 }
402
403 return errors.WithStack(&errors.Error{
404 Kind: ErrMustBeDefined,
405 Message: msg,
406 })
407}
408
409func ErrorMapMustBeDefined(keys ...string) error {
410 message := "must be defined"

Callers 15

ValidateBoolMissingFunction · 0.85
ValidateInt64MissingFunction · 0.85
ValidateFloat64MissingFunction · 0.85
ValidateIntMissingFunction · 0.85
ValidateInt32PtrMissingFunction · 0.85
ValidateIntPtrMissingFunction · 0.85
ValidateInt32ListMissingFunction · 0.85
ValidateStringPtrMissingFunction · 0.85
ValidateInterfaceMissingFunction · 0.85

Calls 1

WithStackFunction · 0.92

Tested by

no test coverage detected