Introduction
Skilled developers design their software for errors. Error handling is the art of failing gracefully. Although you completely control your code, you don’t control outside events and resources. These include user input, network connections, available system memory and files your app needs to access.
In this module, you’ll learn the fundamentals of error handling — what it is and different strategies for implementing good error handling.
Learning Objectives
In this lesson, you’ll review these basic error-handling topics:
- Handling errors with optionals including
try?andtry!. - Handling errors from throwing functions in
do-catchblocks. - Potential issues with
throw-catch.