Advanced Swift: Error Handling, Episode 5: Handling Objective C Errors | Kodeco, the new

App developers deal with errors from UIKit and other Objective-C libraries. Find out how they work with Swift.

This is a companion discussion topic for the original entry at

Not entirely sure when it has changed, but it looks like catching an error with associated value as an NSError no longer loses the associated value.

enum FancyError: Error {
  case kazam(String)

do {
  throw FancyError.kazam("Help")
catch (let error as NSError) {


- __lldb_expr_28.FancyError.kazam("Help") #0
  - super: NSError
    - super: NSObject