Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

异常类

class ZlibException

public class ZlibException <: Exception {
    public init(message: String)
}

功能:zlib 包的异常类。

父类型:

  • Exception

init(String)

public init(message: String)

功能:根据异常信息创建 ZlibException 实例。

参数:

  • message: String - 异常提示信息。

示例:

import stdx.compress.zlib.*

main(): Unit {
    try {
        throw ZlibException("This is a test exception.")
    } catch (e: ZlibException) {
        println("捕获到 ZlibException: ${e.message}")
    }
}

运行结果:

捕获到 ZlibException: This is a test exception.