Introduce Throwable.toStringWithTrace

#KT-37603
This commit is contained in:
Ilya Gorbunov
2020-03-18 07:49:26 +03:00
parent 7b7263c5bf
commit 552bcdb31b
7 changed files with 154 additions and 4 deletions
@@ -118,6 +118,17 @@ internal class KotlinNothingValueException : RuntimeException {
}
/**
* Returns the detailed description of this throwable with its stack trace.
*
* The detailed description includes:
* - the short description (see [Throwable.toString]) of this throwable;
* - the complete stack trace;
* - detailed descriptions of the exceptions that were [suppressed][suppressedExceptions] in order to deliver this exception;
* - the detailed description of each throwable in the [Throwable.cause] chain.
*/
@SinceKotlin("1.4")
public expect fun Throwable.toStringWithTrace(): String
/**
* When supported by the platform, adds the specified exception to the list of exceptions that were
* suppressed in order to deliver this exception.