W3cubDocs

/Kotlin

Throwable

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.3)
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

Platform and version requirements: JVM (1.0), JS (1.0), 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

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

cause

the cause of this throwable.

open val cause: Throwable?
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

message

the detail message string.

open val message: String?

Functions

Platform and version requirements: Native (1.3)

getStackTrace

fun getStackTrace(): Array<String>
Platform and version requirements: Native (1.3)

printStackTrace

fun printStackTrace()
Platform and version requirements: Native (1.3)

toString

Returns a string representation of the object.

open fun toString(): String

Extension Properties

Platform and version requirements: 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

Platform and version requirements: JVM (1.0)

addSuppressed

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

fun Throwable.addSuppressed(exception: Throwable)
Platform and version requirements: JVM (1.0)

printStackTrace

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

fun Throwable.printStackTrace()

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

fun Throwable.printStackTrace(writer: PrintWriter)

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

fun Throwable.printStackTrace(stream: PrintStream)

Inheritors

Error

Platform and version requirements: JS (1.1), Native (1.3)
open class Error : Throwable
Platform and version requirements: JVM (1.1)
typealias Error = Error

Exception

Platform and version requirements: JS (1.1), Native (1.3)
open class Exception : Throwable
Platform and version requirements: JVM (1.1)
typealias Exception = Exception

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