I could not find any standard error classes/enums in docs. For example, I have the following error situations:
- Invalid null parameter
- Parameter value out of range
- Property value (of T!) not set
There's not, AFAIK.
But you can easily define your error cases:
enum ErrorCode: Error {
case nullValue(_ param: Int?, _ msg: String = "Invalid null parameter")
case OutOfRange(_ param: Int, _ msg: String = "Parameter value out of range")
case valueNotSet(_ t: T?, _ msg: String = "Property value (of T!) not set")
}