diff --git a/static/tools.js b/static/tools.js index 1f5e3474f2..9fcbbf2a81 100644 --- a/static/tools.js +++ b/static/tools.js @@ -24,6 +24,11 @@ async function progressiveFetch(resource, callbacks={}) { const lengthBytes = response.headers.get('content-length'); let loadedBytes = 0; + // don't hang on error + if (response.status !== 200) { + cb.finish({ filename, lengthBytes: 0 }); + } + function update() { const loaded = Math.min(1.0, loadedBytes / lengthBytes); const loadedPercent = loaded * 100.0;