Throwable

在脚本中使用的异常.

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun also(block: (Throwable) -> Unit): ObjectWrapper<Throwable>

对 ObjectWrapper 调用给定的 block 函数,并返回 ObjectWrapper 本身。

Link copied to clipboard
abstract fun apply(block: Throwable.() -> Unit): ObjectWrapper<Throwable>

对 ObjectWrapper 调用给定的 block 函数,并返回 ObjectWrapper 本身。

Link copied to clipboard
abstract fun getCause(): Throwable?

获取导致异常的原因.

Link copied to clipboard
abstract fun getMessage(): String?

获取异常信息.

Link copied to clipboard
abstract fun getOrigin(): Throwable

获取原始的对象.

Link copied to clipboard
abstract fun getThrowable(): Throwable

获取真正的 kotlin.Throwable 对象.

Link copied to clipboard
abstract fun <R> let(block: (Throwable) -> R): ObjectWrapper<R>?

对 ObjectWrapper 调用给定的 block 函数,并返回 block 函数的结果包装在 ObjectWrapper 中。

Link copied to clipboard
abstract fun printStackTrace()

将此 Throwable 及其回溯以错误等级打印到控制台。

Link copied to clipboard
abstract fun <R> run(block: Throwable.() -> R): ObjectWrapper<R>?

对 ObjectWrapper 调用给定的 block 函数,并返回 block 函数的结果包装在 ObjectWrapper 中。

Link copied to clipboard
abstract fun stackTraceToString(): String

返回此 Throwable 及其堆栈跟踪的详细描述. 详细描述包括: 此 Throwable 的简短描述 (参见 Throwable.toString); 完整的堆栈跟踪; 为了传递此异常而被抑制的异常的详细描述; Throwable.getCause 链中每个 Throwable 的详细描述.

Link copied to clipboard
abstract fun takeIf(predicate: (Throwable) -> Boolean): ObjectWrapper<Throwable>?

如果 ObjectWrapper 满足给定的 predicate,则返回 ObjectWrapper 本身,否则返回 null 包装在 ObjectWrapper? 中。

Link copied to clipboard
abstract fun takeUnless(predicate: (Throwable) -> Boolean): ObjectWrapper<Throwable>?

如果 ObjectWrapper 不满足给定的 predicate,则返回 ObjectWrapper 本身,否则返回 null 包装在 ObjectWrapper? 中。

Link copied to clipboard
abstract override fun toString(): String

返回此 Throwable 的简短描述.结果是以下内容的串联: 此对象的类名 ":"(冒号和空格) 调用此对象的 getMessage 方法的结果, 如果 getMessage 返回 null, 则仅返回类名