All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jchanghong.lang.Exceptions.kt Maven / Gradle / Ivy

There is a newer version: 3.0.38
Show newest version
package jchanghong.lang

import cn.hutool.core.exceptions.ExceptionUtil

/**
 *
 * @author : jiangchanghong
 *
 * @version : 2020-03-03 17:22
 **/
fun Throwable.printStr(containline:String): String {
    val list = ExceptionUtil.stacktraceToString(this).split("""\s+""".toRegex())
    val message = list.filter { it.contains(containline) }
    return """
        |${ExceptionUtil.getMessage(this)}
        |${ message.joinToString(separator = "\n")}
    """.trimMargin()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy