How get the list of errors thrown by a function?

When the Swift docs says a function throws, they mean that it throws an ErrorType (in Cocoa APIs usually an NSError), not an exception. Consider the following do-try-catch flow for NSFileManager‘s createDirectoryAtPath: let documentsPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] do { try NSFileManager.defaultManager().createDirectoryAtPath(documentsPath, withIntermediateDirectories: false, attributes: nil) } catch { // ‘error’ variable automatically populated print(error) … Read more