iOS Error Handling in Swift Error Handling Handling Errors

Johnny Nguyen
Johnny Nguyen
2,318 Points

Do we need to use error handling in every function we have?

Or just complicate function that we know that there will contain the errors

2 Answers

Bruce Röttgers
Bruce Röttgers
15,682 Points

If they are ‚throwing‘ you need to do error handling.

Johnny Nguyen
Johnny Nguyen
2,318 Points

But when do we know that it's throwing

Bruce Röttgers
Bruce Röttgers
15,682 Points

Indicated by Keyword throws in function declaration: func test() throws { }