fix(errors): dedupe identical messages when traversing error .cause c… · openclaw/openclaw@447a364
RomneyDa
·
2026-05-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -88,6 +88,13 @@ describe("error helpers", () => {
|
88 | 88 | expect(formatted).toBe("error A | error B"); |
89 | 89 | }); |
90 | 90 | |
| 91 | +it("dedupes repeated cause messages while preserving deeper distinct causes", () => { |
| 92 | +const rootCause = new Error("provider auth lookup failed"); |
| 93 | +const inner = new Error('No API key found for provider "openai-codex".', { cause: rootCause }); |
| 94 | +const wrapper = new Error(inner.message, { cause: inner }); |
| 95 | +expect(formatErrorMessage(wrapper)).toBe(`${inner.message} | ${rootCause.message}`); |
| 96 | +}); |
| 97 | + |
91 | 98 | it("redacts sensitive tokens from formatted error messages", () => { |
92 | 99 | const token = "sk-abcdefghijklmnopqrstuv"; |
93 | 100 | const formatted = formatErrorMessage(new Error(`Authorization: Bearer ${token}`)); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。