Drop Throwable#printStackTrace, make it a JVM-specific extension
This commit is contained in:
@@ -7,7 +7,15 @@ import java.io.PrintStream
|
||||
import java.io.PrintWriter
|
||||
|
||||
/**
|
||||
* Allows a stack trace to be printed from Kotlin's [Throwable].
|
||||
* Prints the stack trace of this throwable to the standard output.
|
||||
*/
|
||||
public fun Throwable.printStackTrace(): Unit {
|
||||
val jlt = this as java.lang.Throwable
|
||||
jlt.printStackTrace()
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the stack trace of this throwable to the specified [writer].
|
||||
*/
|
||||
public fun Throwable.printStackTrace(writer: PrintWriter): Unit {
|
||||
val jlt = this as java.lang.Throwable
|
||||
@@ -15,7 +23,7 @@ public fun Throwable.printStackTrace(writer: PrintWriter): Unit {
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows a stack trace to be printed from Kotlin's [Throwable].
|
||||
* Prints the stack trace of this throwable to the specified [stream].
|
||||
*/
|
||||
public fun Throwable.printStackTrace(stream: PrintStream): Unit {
|
||||
val jlt = this as java.lang.Throwable
|
||||
|
||||
Reference in New Issue
Block a user