Skip to content

Commit 4f991ca

Browse files
cdervclaude
andcommitted
Fix error masking in validate-bundle cleanup
Wrap cleanup `Deno.removeSync` calls in try-catch so that failures to remove files that don't yet exist (e.g. when validation fails before creating them) don't mask the real error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b18d485 commit 4f991ca

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

package/src/common/validate-bundle.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ export async function validateBundle(
6666
} finally {
6767
const cleanupFiles = [moveScriptDest, outFile, "package-lock.json", "node_modules"];
6868
cleanupFiles.forEach((file) => {
69-
Deno.removeSync(file, {recursive: true});
69+
try {
70+
Deno.removeSync(file, {recursive: true});
71+
} catch (_e) {
72+
// File may not exist if validation failed early
73+
}
7074
})
71-
7275
}
7376
}

0 commit comments

Comments
 (0)