Skip to content

Conversation

@johnleider
Copy link
Member

Summary

Improves developer experience by providing actionable error messages instead of generic failures. Users now see:

  • What failed - specific operation (template download, feature application, etc.)
  • Why it failed - root cause from the underlying error
  • How to fix it - context-aware suggestions based on failure mode

Error Types Added

Error Type When Thrown Example Suggestion
TemplateDownloadError Network/fetch failures "Check your network connection and try again."
TemplateCopyError Local template copy fails "Check that you have read permissions for the template directory."
FeatureApplyError Feature config fails "Try creating the project without this feature and adding it manually."
DependencyInstallError npm/pnpm install fails "Try running 'pnpm install' manually in the project directory."
FileParseError Analyze can't parse file "The file may contain syntax errors. Fix them and try again."
DirectoryNotFoundError Target dir doesn't exist "Verify the path is correct and the directory exists."

Analyze Command Improvements

Files that fail to parse are now:

  • Tracked and included in the report (parseErrors field)
  • Displayed in console output (up to 10 files with reasons)
  • Available for JSON reporter consumers

Before:

Failed to create project: Error: ENOENT: no such file or directory

After:

Failed to copy template from "/path/to/template": ENOENT: no such file or directory
  Suggestion: Verify the template path exists and is accessible.

Test plan

  • Build passes (pnpm build)
  • Lint passes (pre-existing catalog item warning unrelated to changes)
  • Manual test: trigger template download error (disconnect network)
  • Manual test: trigger feature apply error (malformed template)
  • Manual test: run analyze on project with syntax errors

Add VuetifyCliError base class with actionable suggestions to help
developers resolve issues quickly. Each error type provides context-aware
messages based on the failure mode (network, permissions, syntax, etc).

Changes:
- Add errors.ts with structured error types (TemplateDownloadError,
  TemplateCopyError, FeatureApplyError, DependencyInstallError, etc)
- Update scaffold.ts to throw typed errors with suggestions
- Update create.ts to format errors with suggestions for users
- Update analyze.ts to track and report file parse failures
- Update console reporter to display skipped files with reasons
- Add parseErrors field to AnalyzeReport for programmatic access
@johnleider johnleider force-pushed the feat/improved-error-handling branch from 10104fd to 3457b7c Compare January 15, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant