kotlin.Throwable

Throwable

open class Throwable

The base class for all errors and exceptions. Only instances of this class can be thrown or caught.

Parameters

message - the detail message string.

cause - the cause of this throwable.

Constructors

<init>

Throwable(message: String?)
Throwable(cause: Throwable?)
Throwable()
Throwable(message: String?, cause: Throwable?)

The base class for all errors and exceptions. Only instances of this class can be thrown or caught.

Properties

cause

open val cause: Throwable?

message

open val message: String?

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Properties

stackTrace

val Throwable.stackTrace: Array<StackTraceElement>

Returns an array of stack trace elements representing the stack trace pertaining to this throwable.

Extension Functions

addSuppressed

fun Throwable.addSuppressed(exception: Throwable)

When supported by the platform adds the specified exception to the list of exceptions that were suppressed in order to deliver this exception.

printStackTrace

fun Throwable.printStackTrace()

Prints the stack trace of this throwable to the standard output.

fun Throwable.printStackTrace(writer: PrintWriter)

Prints the stack trace of this throwable to the specified writer.

fun Throwable.printStackTrace(stream: PrintStream)

Prints the stack trace of this throwable to the specified stream.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部