diff --git a/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt b/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt index c7b39ea..163c492 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/utility/misc/StackTraceUtils.kt @@ -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)}") + } } /**