Straying From the Happy Path: Taking Control of Errors in Swift
summary
Survey of Swift error handling that names concrete techniques: use of throws and Result for sync and async, dataTaskPublisher and catch to emit placeholder for Combine, and XCTest assertions to verify failure cases. Shows a reusable pattern to replace fatalError with test closure so crashing paths are exercised and asserted, enabling the claim of 100% test coverage for even “impossible” branches. Includes a table‑view dequeue example and working test harness that makes coverage and behavior observable.
AI-written summary · about
chapters (20)
- 0:00Intro
- 0:15Straying From the Happy Path Taking Control of Errors in Swift
- 2:26Error Handling in Objective-C
- 4:39Errors in Swift Result
- 5:08Result in Practice
- 6:48Result in Actual Practice
- 7:46Objective-C Error Handling in Practice
- 9:49The Swift Error Type
- 11:59Advanced throws
- 12:54The Error Type
- 13:07Effective Swift Errors Logging
- 15:01Testing Result
- 17:50Testing throws
- 18:36Testing fatalError()
- 21:38When to Use fatalError()
- 22:38Swift Assertion Methods
- 28:01Combine Operators
- 28:47Combine Publishers The Never Type
- 29:36SwiftUl and Errors
- 33:02Questions?
related talks
37mStraying From the Happy Path: Taking Control of Errors in Swift
23mLessons in Swift Error Handling and Resilience
50mWriting Swift code with great testability
37mManaging Side Effects with Swift
55mEmerging Best Practices
30mLeveraging Swift's Type System
40mLeveraging Swift’s Type System
46mHacking With Swift
