Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func makeASandwich() throws {
- // ...
- }
- do {
- try makeASandwich()
- eatASandwich()
- } catch SandwichError.outOfCleanDishes {
- washDishes()
- } catch SandwichError.missingIngredients(let ingredients) {
- buyGroceries(ingredients)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement