Skip to content

Commit 789668d

Browse files
author
Luca Forstner
authored
fix: Don't crash on failed delete after upload (#373)
1 parent ee97da4 commit 789668d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/bundler-plugin-core/src/debug-id-upload.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,13 @@ export function createDebugIdUploadFunction({
181181
});
182182
await Promise.all(
183183
filePathsToDelete.map((filePathToDelete) =>
184-
fs.promises.rm(filePathToDelete, { force: true })
184+
fs.promises.rm(filePathToDelete, { force: true }).catch((e) => {
185+
// This is allowed to fail - we just don't do anything
186+
logger.debug(
187+
`An error occured while attempting to delete asset: ${filePathToDelete}`,
188+
e
189+
);
190+
})
185191
)
186192
);
187193
deleteSpan.finish();

0 commit comments

Comments
 (0)