Skip to content
Open

Test yz #3158

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,18 @@ public void handle(Map data) {
public void handle(ErrorCode errCode, Map data) {
new BootErrorLog().write(errCode.toString());
ret.success = false;

}
}).start();
} finally {
lock.unlock();
try {
lock.unlock();

} catch (Exception e) {
ErrorCode errCode = Platform.inerr(e.getMessage());
new BootErrorLog().write(errCode.toString());
ret.success = false;
Comment on lines +620 to +623
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

注意 getMessage() 可能返回 null

e.getMessage() 可能返回 null,这会导致生成的错误码信息不完整。虽然 Platform.inerr() 内部可能会处理这种情况,但建议在此处添加防御性检查,确保错误信息的完整性。

此外,这段错误处理逻辑与第 611-612 行的 FlowErrorHandler 中的代码模式类似。根据团队对核心逻辑稳定性的重视(参考 learnings),当前的重复是可以接受的,但如果未来有统一错误处理的需求,可以考虑提取公共方法。

🔎 防御性检查建议
-ErrorCode errCode = Platform.inerr(e.getMessage());
+ErrorCode errCode = Platform.inerr(e.getMessage() != null ? e.getMessage() : "Unknown error during lock unlock");

Based on learnings, 团队倾向于保持核心逻辑的稳定性,因此代码重复在此场景下是可接受的。

}
}

if (!ret.success || !Platform.IS_RUNNING) {
Expand Down