mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Modify replace app errors info's display text "null" to "unknown" in AppErrorsInfoBean
This commit is contained in:
@@ -66,20 +66,20 @@ data class AppErrorsInfoBean(
|
|||||||
fun clone(packageName: String?, crashInfo: ApplicationErrorReport.CrashInfo?) =
|
fun clone(packageName: String?, crashInfo: ApplicationErrorReport.CrashInfo?) =
|
||||||
(crashInfo?.exceptionClassName?.lowercase() == "native crash").let { isNativeCrash ->
|
(crashInfo?.exceptionClassName?.lowercase() == "native crash").let { isNativeCrash ->
|
||||||
AppErrorsInfoBean(
|
AppErrorsInfoBean(
|
||||||
packageName = packageName ?: "null",
|
packageName = packageName ?: "unknown",
|
||||||
isNativeCrash = isNativeCrash,
|
isNativeCrash = isNativeCrash,
|
||||||
exceptionClassName = crashInfo?.exceptionClassName ?: "null",
|
exceptionClassName = crashInfo?.exceptionClassName ?: "unknown",
|
||||||
exceptionMessage = if (isNativeCrash) crashInfo?.stackTrace.let {
|
exceptionMessage = if (isNativeCrash) crashInfo?.stackTrace.let {
|
||||||
if (it?.contains(other = "Abort message: '") == true)
|
if (it?.contains(other = "Abort message: '") == true)
|
||||||
runCatching { it.split("Abort message: '")[1].split("'")[0] }.getOrNull()
|
runCatching { it.split("Abort message: '")[1].split("'")[0] }.getOrNull()
|
||||||
?: crashInfo?.exceptionMessage ?: "null"
|
?: crashInfo?.exceptionMessage ?: "unknown"
|
||||||
else crashInfo?.exceptionMessage ?: "null"
|
else crashInfo?.exceptionMessage ?: "unknown"
|
||||||
} else crashInfo?.exceptionMessage ?: "null",
|
} else crashInfo?.exceptionMessage ?: "unknown",
|
||||||
throwFileName = crashInfo?.throwFileName ?: "null",
|
throwFileName = crashInfo?.throwFileName ?: "unknown",
|
||||||
throwClassName = crashInfo?.throwClassName ?: "null",
|
throwClassName = crashInfo?.throwClassName ?: "unknown",
|
||||||
throwMethodName = crashInfo?.throwMethodName ?: "null",
|
throwMethodName = crashInfo?.throwMethodName ?: "unknown",
|
||||||
throwLineNumber = crashInfo?.throwLineNumber ?: -1,
|
throwLineNumber = crashInfo?.throwLineNumber ?: -1,
|
||||||
stackTrace = crashInfo?.stackTrace?.trim() ?: "null",
|
stackTrace = crashInfo?.stackTrace?.trim() ?: "unknown",
|
||||||
timestamp = System.currentTimeMillis()
|
timestamp = System.currentTimeMillis()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user