fix(errors): improve recovery guidance

This commit is contained in:
morluto
2026-07-13 19:09:27 +00:00
parent af8c4efb4a
commit 77454dc8f4
42 changed files with 1492 additions and 304 deletions
+9 -14
View File
@@ -99,18 +99,20 @@ describe("analysis error projection", () => {
const projected = errors.map(projectAnalysisError);
expect(projected).toHaveLength(23);
const serialized = JSON.stringify(projected);
for (const hidden of ["secret-token", "/secret/local/path"])
for (const hidden of [
"secret-token",
"/secret/local/path",
"fixture",
"overview",
"AnalysisCapabilityUnavailableError",
"main.js",
"declaredSha256",
])
expect(serialized).not.toContain(hidden);
expect(
projectAnalysisError(byTag.AnalysisCapabilityUnavailableError),
).toMatchObject({
tag: "AnalysisCapabilityUnavailableError",
category: "unsupported_provider",
details: {
providerId: "fixture",
operation: "overview",
reason: "absent",
},
});
expect(
projectAnalysisError(
@@ -122,14 +124,7 @@ describe("analysis error projection", () => {
}),
),
).toMatchObject({
tag: "ArtifactOperationError",
category: "integrity_mismatch",
details: {
logicalPath: "main.js",
declaredSha256: "a".repeat(64),
calculatedSha256: "b".repeat(64),
unpacked: true,
},
});
expect(projected.every(({ message }) => message.length > 0)).toBe(true);
expect(