I'm trying process string and set "try"
var str = String()
do{
let str = try self.processMyString(strToProcess)
}catch{
}
But I'm getting this error:
no calls to throwing functions occur within 'try' expression
Any of you knows why of this error or how can I fix it?
I'll really appreciate your help.
If your function can cause errors, define it like this
func canThrowErrors() throws -> String
like found here
Then you can use the try like you did already.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With