Throwable

Common
JVM
JS
Native
1.0

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

Common
JVM
JS
Native
1.0

<init>

<init>(message: String?)
<init>(cause: Throwable?)
<init>()

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

<init>(message: String?, cause: Throwable?)

Properties

Common
JVM
JS
Native
1.0

cause

the cause of this throwable.

open val cause: Throwable?
Common
JVM
JS
Native
1.0

message

the detail message string.

open val message: String?

Functions

Native
1.3

getStackTrace

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

fun getStackTrace(): Array<String>
Native
1.3

printStackTrace

Prints the detailed description of this throwable to the standard error output.

fun printStackTrace()
JS
Native
1.1

toString

Returns a string representation of the object.

open fun toString(): String

Extension Properties

JVM
1.0

stackTrace

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

val Throwable.stackTrace: Array<StackTraceElement>

Extension Functions

Native
1.3

getStackTraceAddresses

Returns a list of stack trace addresses representing the stack trace pertaining to this throwable.

fun Throwable.getStackTraceAddresses(): List<Long>
JVM
1.0

printStackTrace

Prints the detailed description of this throwable to the specified writer.

fun Throwable.printStackTrace(writer: PrintWriter)

Prints the detailed description of this throwable to the specified stream.

fun Throwable.printStackTrace(stream: PrintStream)

Inheritors

Error

Common
JS
Native
1.0
open class Error : Throwable
JVM
1.1
typealias Error = Error

Exception

Common
JS
Native
1.0
open class Exception : Throwable
JVM
1.1
typealias Exception = Exception