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 TarException

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

功能:tar 包的异常类。

父类型:

  • Exception

init(String)

public init(message: String)

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

参数:

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

示例:

import stdx.compress.tar.*

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

运行结果:

捕获到 TarException: This is a test exception