From 30abf028909e462e4905484d442f152c7ac96e2d Mon Sep 17 00:00:00 2001 From: wengchongjian <1127114524@qq.com> Date: Tue, 7 May 2024 18:38:50 +0800 Subject: [PATCH] =?UTF-8?q?[bugfix]=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=8D=95=E6=8D=89ConcurrentModificationException=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/yc/toollib/crash/CrashFileUtils.java | 2 +- .../src/main/java/com/yc/toollib/crash/CrashHandler.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashFileUtils.java b/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashFileUtils.java index 35d04e5..b9bf213 100644 --- a/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashFileUtils.java +++ b/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashFileUtils.java @@ -207,7 +207,7 @@ private static void dumpExceptionToFile(Context context , Throwable ex) { if (string.contains(":")){ splitEx = ex.toString().split(":")[0]; } else { - splitEx = "java.lang.Exception"; + splitEx = ex.toString(); } String newName = "V" + versionName + "_" + crashTime + "_" + splitEx + CRASH_REPORTER_EXTENSION; File newFile = new File(dir, newName); diff --git a/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashHandler.java b/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashHandler.java index 9031393..819d3ad 100644 --- a/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashHandler.java +++ b/MonitorCrashLib/src/main/java/com/yc/toollib/crash/CrashHandler.java @@ -157,6 +157,9 @@ private boolean handleException(Throwable ex) { } //收集crash信息 String msg = ex.getLocalizedMessage(); + if (msg == null) { + msg = ex.getStackTrace().toString(); + } if (msg == null) { return false; }