Throw inside a do block and catch it back in Swift? Yes

Lazy forks, it's just simple topic, but I did the experiment for you:

enum SomeError: Error {
    case notBig
    case veryBig
func someErrorFucntion() {
    do {
        throw SomeError.veryBig
    } catch {

someErrorFucntion() // And it will print veryBig!!

Subscribe to

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.