异常处理增强

This commit is contained in:
2026-04-25 06:26:20 +08:00
parent 4eff975b8e
commit 5dcf477ced
4 changed files with 25 additions and 11 deletions

View File

@@ -242,7 +242,13 @@ public class LogBus implements BaseParams {
if (log instanceof JSONObject jsonLog) {
logBody.setLogData(jsonLog);
} else {
logBody.setLogData(JSONObject.from(log));
JSONObject logData;
try {
logData = JSONObject.from(log);
} catch (Exception e) {
logData = JSONObject.of("data", log);
}
logBody.setLogData(logData);
}
return this;
}