Loading lesson…
Level 1 · Apprentice0 XP
Recoverable errors as values, the ? operator, and thiserror and anyhow.
Step 1 / 6
ProblemIn Java, any call might throw an unchecked exception. Reading the code, you cannot tell which calls can fail.
← → step
Before this: Structs, enums and pattern matching
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Write a library function that reads a TOML or JSON config file and returns Result<Config, ConfigError> with thiserror variants for I/O, parse and validation errors. Use anyhow with .context() in main.