From the course: Learning Combine with Swift
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Handle errors with Combine - Swift Tutorial
From the course: Learning Combine with Swift
Handle errors with Combine
- [Instructor] An important aspect of coding is being able to account for errors or in other words, handle errors. Like any other framework Combine is certain to encounter errors, from networking to decoding to incorrect credentials. As a good citizen programmer, it is imperative that you handle the unexpected in a graceful manner. In this video, we're going to talk about all the different ways in which you can error handle your Combine pipelines. In Combine, errors are not an afterthought. As a matter of fact, the framework forces you to think about and declare, in advanced, a type error definition, early on. There are a few ways in which Combine lets you work with errors, first of which is leveraging the operator mapError. This is akin to map operator used to map multiple events, emitted through a filtering mechanism to a singular response. For network related matters such as temporary connectivity, you can always use…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.