mirror of
https://github.com/rizsotto/Bear.git
synced 2026-05-28 00:20:45 +02:00
c21b8d5901
Every fallible function in bear-codegen now returns anyhow::Result
instead of panicking. Error context chains give YAML authors readable
messages when something is wrong:
error: flag codegen failed
caused by: generating flags for gcc.yaml
caused by: flag '-c'
caused by: unknown result value 'bogus_value'
Changes:
- result_to_rust returns Result instead of panicking
- EnvEntry::validate returns anyhow::Result (was Result<_, String>)
- EnvMappingYaml::to_rust returns Result instead of unreachable!()
- resolve_flags returns anyhow::Result (was Result<_, String>)
- ResolvedTable::new and generate return Result
- generate() returns Result; build.rs prints the error chain on failure
- load_tables returns Result
- All callers use .context() / .with_context() for layered messages
- Tests assert on .is_err() and error message content
- Removed EnvEntry::validate yaml_file parameter (context added by caller)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>