mirror of
https://github.com/scratchfoundation/scratch-storage.git
synced 2025-07-16 09:13:54 -04:00
Merge pull request #32 from wdr-data/fix-404-handling
Skip to next source if a source responds with 404
This commit is contained in:
commit
fe93eaedae
1 changed files with 1 additions and 1 deletions
|
@ -70,7 +70,7 @@ class WebHelper extends Helper {
|
||||||
|
|
||||||
nets({url: url}, (err, resp, body) => {
|
nets({url: url}, (err, resp, body) => {
|
||||||
// body is a Buffer
|
// body is a Buffer
|
||||||
if (err) {
|
if (err || Math.floor(resp.statusCode / 100) !== 2) {
|
||||||
tryNextSource();
|
tryNextSource();
|
||||||
} else {
|
} else {
|
||||||
asset.setData(body, dataFormat);
|
asset.setData(body, dataFormat);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue