diff --git a/src/js/assets.js b/src/js/assets.js index 5e2a7dd5d..5a6b97525 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -787,6 +787,7 @@ assets.get = async function(assetKey, options = {}) { contentURLs.push(...assetDetails.cdnURLs); } + let error = 'ENOTFOUND'; for ( const contentURL of contentURLs ) { if ( reIsExternalPath.test(contentURL) && assetDetails.hasLocalURL ) { continue; @@ -794,6 +795,9 @@ assets.get = async function(assetKey, options = {}) { const details = assetDetails.content === 'filters' ? await assets.fetchFilterList(contentURL) : await assets.fetchText(contentURL); + if ( details.error !== undefined ) { + error = details.error; + } if ( details.content === '' ) { continue; } if ( reIsExternalPath.test(contentURL) && options.dontCache !== true ) { assetCacheWrite(assetKey, { @@ -804,7 +808,12 @@ assets.get = async function(assetKey, options = {}) { } return reportBack(details.content, contentURL); } - return reportBack('', '', 'ENOTFOUND'); + if ( assetRegistry[assetKey] !== undefined ) { + registerAssetSource(assetKey, { + error: { time: Date.now(), error } + }); + } + return reportBack('', '', error); }; /******************************************************************************/