Problem Statement
Explain how error propagation works in Swift when calling multiple throwing functions and how you would design an API accordingly.
Explanation
When a Swift function calls other functions that throw errors, you have two choices: handle the error locally using `do-catch`, or propagate it by re-marking your function with `throws`. This allows higher-level code to decide how to handle the error. /n/n Designing an API means you decide where errors should be handled: library code might throw detailed errors while UI code catches and displays user-friendly messages. Using `Result` types for asynchronous APIs is another pattern. Clear propagation and error mapping (from low-level errors to domain-specific ones) improve maintainability and robustness.