constructor() — ui Function Reference
Architecture documentation for the constructor() function in errors.ts from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 49e98dfc_1ffc_e51e_3c05_621e0585eda7["constructor()"] d6a998dd_5dcd_fa0a_d040_5bb815b5320b["RegistriesIndexParseError"] 49e98dfc_1ffc_e51e_3c05_621e0585eda7 -->|defined in| d6a998dd_5dcd_fa0a_d040_5bb815b5320b style 49e98dfc_1ffc_e51e_3c05_621e0585eda7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/src/registry/errors.ts lines 292–324
constructor(parseError: unknown) {
let message = "Failed to parse registries index"
if (parseError instanceof z.ZodError) {
const invalidNamespaces = parseError.errors
.filter((e) => e.path.length > 0)
.map((e) => `"${e.path[0]}"`)
.filter((v, i, arr) => arr.indexOf(v) === i) // remove duplicates
if (invalidNamespaces.length > 0) {
message = `Failed to parse registries index. Invalid registry namespace(s): ${invalidNamespaces.join(
", "
)}\n${parseError.errors
.map((e) => ` - ${e.path.join(".")}: ${e.message}`)
.join("\n")}`
} else {
message = `Failed to parse registries index:\n${parseError.errors
.map((e) => ` - ${e.path.join(".")}: ${e.message}`)
.join("\n")}`
}
}
super(message, {
code: RegistryErrorCode.PARSE_ERROR,
cause: parseError,
context: { parseError },
suggestion:
"The registries index may be corrupted or have invalid registry namespace format. Registry names must start with @ (e.g., @shadcn, @example).",
})
this.parseError = parseError
this.name = "RegistriesIndexParseError"
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does constructor() do?
constructor() is a function in the ui codebase, defined in packages/shadcn/src/registry/errors.ts.
Where is constructor() defined?
constructor() is defined in packages/shadcn/src/registry/errors.ts at line 292.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free