Swift offers exception-handling capabilities that are useful in situations when errors are out of programmer's control (missing files, dropped connections, et cetera). Although I could use the same mechanism for reporting situations caused by programmer's errors (index out of bounds, range errors, et cetera) I am wondering if that is the intended way of using exceptions.
In Objective-C code a common way to deal with these situations was through asserts. On the other hand, using exceptions was somewhat discouraged in Objective-C, so there may be no one-for-one substitution here.
Similarly, in Java there are checked and unchecked exceptions, with the intention to use unchecked ones for programmer's mistakes.
My understanding is that there is no checked/unchecked distinction among exceptions in Swift. I would like to find out if using exceptions or asserts is the proper way of reporting programmer's mistakes in Swift, or if I should use some other mechanism?