定义异常类型

异常处理

class SimpleException: Exception()

class RecommendExc: Exception {
    //recommended constructors
    constructor(): super()
    constructor(message: String): super(message)
}

throw SimpleException() //<- Error

throw RecommendExc("exeption") //<- Error