Indent throwable message
This commit is contained in:
parent
59c9e7b156
commit
3adc48e8a2
1 changed files with 6 additions and 1 deletions
|
@ -57,7 +57,12 @@ fun Any.methodCaller(depth: UInt = 1u): Origin {
|
|||
* @since v1-alpha10
|
||||
*/
|
||||
fun Throwable.stacktraceHeader(): String {
|
||||
return "Caused by: ${this.javaClass.name}${if (this.message == null) "" else ": ${this.message}"}"
|
||||
if (message == null)
|
||||
return "Caused by: ${this.javaClass.name}"
|
||||
else {
|
||||
val part0: String = "Caused by: ${this.javaClass.name}: "
|
||||
return part0 + message!!.replace("\n", "\n${" ".repeat(part0.length)}")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue