// *** in version 6.0: ***
enum LoadError: Error {
case notFound, denied
}
//the thrown type is now a part
//of the signature
func load(_ name: String) throws(LoadError) {
throw .notFound
}
do {
try load("data.txt")
} catch {
//error is LoadError, not any Error
print("error is \(error)")
}
//error is notFound