Feature / Documentation Overview
The Avenx compiler uses a hierarchy of specialized error classes defined in lib/compiler/errors/:
CompilerError (base diagnosis class inheriting from AvenxError)
TemplateValidationError (specialized for template syntax and static validation warnings/errors like AVX_W02, AVX_W03, AVX_W04)
StyleCompilerError (specialized for CSS preprocessor and scoping errors like AVX_W24)
BuildError (specialized for build pipeline, directory, and bundle budget errors like AVX_C01, AVX_C02, AVX_C03, AVX_W01, AVX_W25)
Currently, docs/src/content/docs/troubleshooting/errors.md only documents AvenxError (the runtime base class) in detail. The compiler error classes lack API documentation (constructors, properties like sourceLine and details, and programmatic catch handling patterns).
Proposed Documentation Changes
Update docs/src/content/docs/troubleshooting/errors.md to add a comprehensive Compiler Error Class Hierarchy section:
- Class Hierarchy Diagram / Overview:
AvenxError -> CompilerError -> (TemplateValidationError, StyleCompilerError, BuildError).
- Constructor Signatures & Properties:
new CompilerError(code, message, details)
new TemplateValidationError(code, message, sourceLine)
new StyleCompilerError(code, message, cssFilePath)
new BuildError(code, message, buildContext)
- Programmatic Catching & Build Pipeline Integration:
- Code examples showing how build tools, Vite plugins, or custom CLI scripts catch and inspect compiler errors programmatically.
Verification & Constraints
- Verified zero duplicate issues exist (checked all open and closed issues 3 times).
- Formatted according to Starlight / Astro markdown documentation guidelines.
Feature / Documentation Overview
The Avenx compiler uses a hierarchy of specialized error classes defined in
lib/compiler/errors/:CompilerError(base diagnosis class inheriting fromAvenxError)TemplateValidationError(specialized for template syntax and static validation warnings/errors likeAVX_W02,AVX_W03,AVX_W04)StyleCompilerError(specialized for CSS preprocessor and scoping errors likeAVX_W24)BuildError(specialized for build pipeline, directory, and bundle budget errors likeAVX_C01,AVX_C02,AVX_C03,AVX_W01,AVX_W25)Currently,
docs/src/content/docs/troubleshooting/errors.mdonly documentsAvenxError(the runtime base class) in detail. The compiler error classes lack API documentation (constructors, properties likesourceLineanddetails, and programmaticcatchhandling patterns).Proposed Documentation Changes
Update
docs/src/content/docs/troubleshooting/errors.mdto add a comprehensive Compiler Error Class Hierarchy section:AvenxError->CompilerError-> (TemplateValidationError,StyleCompilerError,BuildError).new CompilerError(code, message, details)new TemplateValidationError(code, message, sourceLine)new StyleCompilerError(code, message, cssFilePath)new BuildError(code, message, buildContext)Verification & Constraints