Skip to content

Commit

Permalink
feat: also ignore 401 and 403 when downloading assets.
Browse files Browse the repository at this point in the history
  • Loading branch information
atombender committed Dec 19, 2024
1 parent f226bea commit 8f5df3d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/AssetHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,18 @@ class AssetHandler {
try {
return await this.downloadAsset(assetDoc, dstPath)
} catch (err) {
// Ignore missing assets
if (err.statusCode === 404) {
console.warn(`⚠ Asset not found (ignoring): %s`, assetDoc._id)
return false
// Ignore inaccessible assets
switch (err.statusCode) {
case 401:
case 403:
case 404:
console.warn(
`⚠ Asset failed with HTTP %d (ignoring): %s`,
err.statusCode,
assetDoc._id,
)
return true
default:
}

debug(
Expand Down

0 comments on commit 8f5df3d

Please sign in to comment.