Error handling in Swift: try, catch, do and throw Paul Hudson September 23rd 2019 @twostraws Swift works hard to make sure we can write safe software, which means it eliminates many opportunities for our code to fail. One of the ways it accomplishes this is by letting us catch errors when risky code doesn't run according to plan, and in this article I'm going to walk through how that works a