20 Error Handling
How often has a piece of software you have been using crashed or done something it was not supposed to do? The majority of the time, these issues are caused by incorrect error handling. Error handling is one of the unsung heroes of software development: Nobody thinks of it as a priority, and if it is done correctly nobody notices. But it is absolutely critical – users of your software will certainly notice (and complain!) if it is done poorly. In this chapter you will explore the tools that Swift provides to catch and handle errors.
Classes of Errors
There are two broad categories of error that can occur: recoverable errors and nonrecoverable errors.
Recoverable errors are typically events that can occur ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access