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>
<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
cause
the cause of this throwable.
open val cause: Throwable?
message
the detail message string.
open val message: String?
Functions
getStackTrace
Returns an array of stack trace strings representing the stack trace pertaining to this throwable.
fun getStackTrace(): Array<String>
printStackTrace
Prints the detailed description of this throwable to the standard output.
fun printStackTrace()
toString
Returns the short description of this throwable consisting of the exception class name (fully qualified if possible) followed by the exception message if it is not null.
open fun toString(): String
Extension Properties
stackTrace
Returns an array of stack trace elements representing the stack trace pertaining to this throwable.
val Throwable.stackTrace: Array<StackTraceElement>
Extension Functions
getStackTraceAddresses
Returns a list of stack trace addresses representing the stack trace pertaining to this throwable.
fun Throwable.getStackTraceAddresses(): List<Long>
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
open class Error : Throwable
typealias Error = Error
Exception
open class Exception : Throwable
typealias Exception = Exception
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html