Curriculum Errors try and catch exercise 5 · fill-word
try and catch
Fill the missing keyword that consumes an error union and substitutes a default or runs a handler. Five letters, lowercase, same word C++ / Java use.
TypeScript reference
Fill the blanks →
About this theme
There are three ways to consume an error union. try expr is the propagator: on error, return the error to the caller; on success, unwrap the value. expr catch <default> substitutes a fallback value (analogous to optionals orelse). expr catch |err| { ... } captures the error and runs a handler block — pair with a switch on err to handle each case. Once these three are reflex, error handling reads cleanly without exception-handler ceremony.