Chapter 6. Effortless error handling

This chapter covers

  • Error-handling best practices (and downsides)
  • Keeping your application in a proper state when throwing
  • How errors are propagated
  • Adding information for customer-facing applications (and for troubleshooting)
  • Bridging to NSError
  • Making APIs easier to use without harming the integrity of an application

Error handling is an integral part of any software development and not Swift-centric. But how Swift treats error handling does impact the way you deliver code that is pleasant to use and respects problems that can arise in a system. In this chapter, you’ll elegantly throw and catch errors while walking the fine line between creating a useful API instead of a tedious one.

Error handling ...

Get Swift in Depth now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.