Merge pull request from wdr-data/fix-404-handling

Skip to next source if a source responds with 404
This commit is contained in:
Chris Willis-Ford 2018-04-27 08:08:31 -07:00 committed by GitHub
commit fe93eaedae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);