KT-4343 getStackTrace() for Throwables

This commit is contained in:
Jon Renner
2013-12-26 15:54:31 +08:00
committed by Andrey Breslav
parent 5d0c267fdf
commit e99a90b1c2
@@ -38,6 +38,14 @@ public fun Throwable.printStackTrace(stream: PrintStream): Unit {
jlt.printStackTrace(stream)
}
/**
* Returns the stack trace
*/
public fun Throwable.getStackTrace() : Array<StackTraceElement> {
val jlt = this as java.lang.Throwable
return jlt.getStackTrace()!!
}
/**
* A helper method for creating a [[Callable]] from a function