// ErrorClass returns ErrorCSSClass if this field has a validation error, else empty string.
963050
func (f *Field) ErrorClass() string {
	if f.Error != nil {
		if errorClass, ok := f.viewArgs["ERROR_CLASS"]; ok {
			return errorClass.(string)
		}
		return ErrorCSSClass
	}
	return ""
}
732967
func errorCode(err error) codes.Code {
	switch errors.Unwrap(err) {
	case context.DeadlineExceeded:
		return codes.DeadlineExceeded

	case context.Canceled:
		return codes.Canceled

	default:
		return grpc.Code(err)
	}
}
1242439
func (err Error) Error() string {
	switch children := err.Nested.(type) {
	case nil:
		return err.Message

	case []NestedError:
		return formatNestedError(err, children)

	default:
		return err.Message + "\n" +
			BranchDelimiter +
			strings.Replace(
				String(err.Nested),
				"\n",
				"\n"+strings.Repeat(" ", BranchIndent),
				-1,
			)
	}
}
598626
func (f *Field) RemoveLabelClass(class string) FieldInterface {
	ind := -1
	for i, v := range f.labelClass {
		if v == class {
			ind = i
			break
		}
	}

	if ind != -1 {
		f.labelClass = append(f.labelClass[:ind], f.labelClass[ind+1:]...)
	}
	return f
}
818782
func (e *ErrorClass) Is(parent *ErrorClass) bool {
	for check := e; check != nil; check = check.parent {
		if check == parent {
			return true
		}
	}
	return false
}
832953
func ValidateRuntimeClass(rc *node.RuntimeClass) field.ErrorList {
	allErrs := apivalidation.ValidateObjectMeta(&rc.ObjectMeta, false, apivalidation.NameIsDNSSubdomain, field.NewPath("metadata"))

	for _, msg := range apivalidation.NameIsDNSLabel(rc.Handler, false) {
		allErrs = append(allErrs, field.Invalid(field.NewPath("handler"), rc.Handler, msg))
	}

	return allErrs
}
479011
func (v *Validation) ErrorKey(message string, args ...interface{}) *ValidationResult {
	result := v.ValidationResult(false).MessageKey(message, args...)
	v.Errors = append(v.Errors, result.Error)
	return result
}
31887
func (f *FieldSetType) RemoveClass(class string) *FieldSetType {
	delete(f.class, class)
	return f
}
1348079
func (e *Error) Error() string {
	return fmt.Sprintf("[%s:%d]%s", e.class, e.code, e.getMsg())
}
1222137
func Error(w http.ResponseWriter, code int) {
	http.Error(w, http.StatusText(code), code)
}
350088
func (ec *EventClass) Validate() error {
	return validation.ValidateStruct(ec,
		validation.Field(&ec.TableName, validation.Required, validation.Length(1, 60)),
		validation.Field(&ec.Filter, validation.Required),
		validation.Field(&ec.FieldMappings, validation.Required, validation.Length(1, 0)),
	)
}
156782
func (parent *ErrorClass) NewClass(name string,
	options ...ErrorOption) *ErrorClass {

	ec := &ErrorClass{
		parent: parent,
		name:   name,
		data:   make(map[DataKey]interface{})}

	for _, option := range options {
		option(ec.data)
	}

	if !boolWrapper(ec.data[disableInheritance], false) {
		// hoist options for speed
		for key, val := range parent.data {
			_, exists := ec.data[key]
			if !exists {
				ec.data[key] = val
			}
		}
		return ec
	} else {
		delete(ec.data, disableInheritance)
	}

	return ec
}
951285
func (ec ErrClass) String() string {
	switch ec {
	case ClassAutoid:
		return "autoid"
	case ClassDDL:
		return "ddl"
	case ClassDomain:
		return "domain"
	case ClassExecutor:
		return "executor"
	case ClassExpression:
		return "expression"
	case ClassInspectkv:
		return "inspectkv"
	case ClassMeta:
		return "meta"
	case ClassKV:
		return "kv"
	case ClassOptimizer:
		return "optimizer"
	case ClassParser:
		return "parser"
	case ClassPerfSchema:
		return "perfschema"
	case ClassPrivilege:
		return "privilege"
	case ClassSchema:
		return "schema"
	case ClassServer:
		return "server"
	case ClassStructure:
		return "structure"
	case ClassVariable:
		return "variable"
	case ClassTable:
		return "table"
	case ClassTypes:
		return "types"
	}
	return strconv.Itoa(int(ec))
}
929609
func (r *Rets) ErrorVarName() string {
	if r.ReturnsError {
		return "err"
	}
	if r.Type == "error" {
		return r.Name
	}
	return ""
}
353744
func NewErrorClass(code string, status int) ErrorClass {
	return func(message interface{}, keyvals ...interface{}) error {
		var msg string
		switch actual := message.(type) {
		case string:
			msg = actual
		case error:
			msg = actual.Error()
		case fmt.Stringer:
			msg = actual.String()
		default:
			msg = fmt.Sprintf("%v", actual)
		}
		var meta map[string]interface{}
		l := len(keyvals)
		if l > 0 {
			meta = make(map[string]interface{})
		}
		for i := 0; i < l; i += 2 {
			k := keyvals[i]
			var v interface{} = "MISSING"
			if i+1 < l {
				v = keyvals[i+1]
			}
			meta[fmt.Sprintf("%v", k)] = v
		}
		return &ErrorResponse{ID: newErrorID(), Code: code, Status: status, Detail: msg, Meta: meta}
	}
}
175628
func (self *Error) Error() string {
	return fmt.Sprintf("HTTP Level Error (%d): %s", self.StatusCode, self.Msg)
}
588037
func IsValidScriptClass(name string) (isValid bool) {
	_, isValid = scriptNameToClass[strings.ToLower(name)]
	return
}