Make Throwable.printStackTrace() common
#KT-38044
This commit is contained in:
@@ -17,6 +17,14 @@ package kotlin
|
||||
@SinceKotlin("1.4")
|
||||
public actual fun Throwable.stackTraceToString(): String = ExceptionTraceBuilder().buildFor(this)
|
||||
|
||||
/**
|
||||
* Prints the [detailed description][Throwable.stackTraceToString] of this throwable to console error output.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
public actual fun Throwable.printStackTrace() {
|
||||
console.error(this.stackTraceToString())
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the specified exception to the list of exceptions that were
|
||||
* suppressed in order to deliver this exception.
|
||||
|
||||
Reference in New Issue
Block a user