Home / Function/ constructor() — ui Function Reference

constructor() — ui Function Reference

Architecture documentation for the constructor() function in errors.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  07624763_8a53_88cf_1888_f6561b956f60["constructor()"]
  d0a07e34_9f5b_1e7c_0980_bb0e84055389["InvalidConfigIconLibraryError"]
  07624763_8a53_88cf_1888_f6561b956f60 -->|defined in| d0a07e34_9f5b_1e7c_0980_bb0e84055389
  style 07624763_8a53_88cf_1888_f6561b956f60 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/registry/errors.ts lines 328–344

  constructor(
    public readonly iconLibrary: string,
    public readonly validOptions: string[]
  ) {
    const message = `Invalid icon library "${iconLibrary}". Valid options are: ${validOptions.join(
      ", "
    )}`

    super(message, {
      code: RegistryErrorCode.INVALID_CONFIG,
      context: { iconLibrary, validOptions },
      suggestion: `Update the "iconLibrary" field in your components.json to one of: ${validOptions.join(
        ", "
      )}`,
    })
    this.name = "InvalidConfigIconLibraryError"
  }

Subdomains

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 328.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free