KT-4343 getStackTrace() for Throwables
This commit is contained in:
committed by
Andrey Breslav
parent
5d0c267fdf
commit
e99a90b1c2
@@ -38,6 +38,14 @@ public fun Throwable.printStackTrace(stream: PrintStream): Unit {
|
|||||||
jlt.printStackTrace(stream)
|
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
|
* A helper method for creating a [[Callable]] from a function
|
||||||
|
|||||||
Reference in New Issue
Block a user