3 ms·
This is exactly the Cocoa exception model: Exceptions are treated as assertions, while errors represent things the program or user should be able to act on and
by eschaton 4y ago
This is exactly the Cocoa exception model: Exceptions are treated as assertions, while errors represent things the program or user should be able to act on and recover from. Swift reifies this by not having exceptions at all, just fatal assertions like precondition() and fatalError(), while using try/throw/do/catch for propagation of errors (and making handling them non-optional).