Expand description
§Configuration Error Types
This module defines error types for configuration parsing and validation. Each error variant includes:
- A human-readable message
- A unique error code for documentation lookup
- Source location information (when available)
- Actionable suggestions for fixing the problem
§Error Categories
| Category | Examples |
|---|---|
| Parse Errors | Invalid TOML syntax |
| Type Errors | String where number expected |
| Value Errors | Invalid color format, out of range |
| Schema Errors | Missing required field, unknown key |
§Integration with miette
All errors implement [miette::Diagnostic] for rich terminal output.
When source code is available, errors display the problematic line:
Error: fern::config::invalid_color
× Invalid color format: #gg0000
╭─[config.toml:5:10]
4 │ [appearance]
5 │ accent = "#gg0000"
· ────────── this color value is not valid hex
╰────
help: Colors must be hex format: #RRGGBB or #RRGGBBAA
Examples: #89b4fa, #ff6b6bffStructs§
- Config
Location 🔒 - Location within a configuration file.
Enums§
- Config
Error - Errors that occur during configuration parsing and validation.