Skip to content

Commit

Permalink
refact: log which file failed to upload
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Nov 6, 2023
1 parent a63b87f commit 6eda4a9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/landing/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ async function deploy() {
const invalidationPaths = new Set();

const fileList = await fsa.toArray(fsa.list(basePath));
const promises = fileList.map((filePath) =>
Q(async () => {
const targetKey = filePath.slice(basePath.length);
const promises = fileList.map((filePath) => {
const targetKey = filePath.slice(basePath.length);

return Q(async () => {
const isVersioned = HasVersionRe.test(basename(filePath));
const contentType = mime.contentType(extname(filePath));

Expand Down Expand Up @@ -50,8 +51,11 @@ async function deploy() {
} else {
invalidationPaths.add(targetKey);
}
}),
);
}).catch((e) => {
console.error('UploadFailed', { targetKey, error: String(e) });
throw e;
});
});

await Promise.all(promises);

Expand Down

0 comments on commit 6eda4a9

Please sign in to comment.