{"record":{"id":"5f447121f7e4a308","repo":"weaviate/weaviate","slug":"no-such-class-with-name-s","errorCode":null,"errorMessage":"no such class with name '%s'","messagePattern":"no such class with name '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"entities/schema/backward_compat.go","lineNumber":39,"sourceCode":"\ntype PropertyInterface interface {\n\tGetName() string\n\tGetNestedProperties() []*models.NestedProperty\n}\n\n// GetClassByName returns the class by its name.\nfunc GetClassByName(s *models.Schema, className string) (*models.Class, error) {\n\tif s == nil {\n\t\treturn nil, fmt.Errorf(ErrorNoSuchClass, className)\n\t}\n\n\tfor _, class := range s.Classes {\n\t\t// Check if the name of the class is the given name, that's the class we need\n\t\tif class.Class == className {\n\t\t\treturn class, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(ErrorNoSuchClass, className)\n}\n\n// GetPropertyByName returns a frst-order property by its name.\n// If propName is a name of the nested property, then this property is returned.\n// It is not possible to retrieve deeply nested properties using the dot-notation.\nfunc GetPropertyByName(c *models.Class, propName string) (*models.Property, error) {\n\t// a nested property is addressed by its first dot-notation segment\n\troot, _, _ := strings.Cut(propName, \".\")\n\tfor _, prop := range c.Properties {\n\t\tif prop.Name == root {\n\t\t\treturn prop, nil\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(ErrorNoSuchProperty, propName, c.Class)\n}\n\n// GetPropertyDataType checks whether the given string is a valid data type\nfunc GetPropertyDataType(class *models.Class, propertyName string) (*DataType, error) {","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/entities/schema/backward_compat.go#L21-L57","documentation":"Same not-found condition in GetClassByName as the verbose variant, but formatted with just the class name. This instance is the loop-exhaustion return (or nil-schema return) using the ErrorNoSuchClass template with a single verb — it is the canonical 'class does not exist' sentinel for this legacy helper.","triggerScenarios":"Thrown at entities/schema/backward_compat.go:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the class name against the actual schema and retry","Create the missing class first","If the schema is expected to exist, check that it was passed in and loaded correctly (nil schema also triggers this)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}