In swift, is it possible to use the shorter guard let try?
and get the occuring exception if entering the else block?
guard let smth = try? myThrowingFunc() else {
print(error) //can I access the exception here somehow?
return
}
vs
let smth: AnyObject?
do {
smth = try myThrowingFunc()
} catch let error {
print(error)
return
}