fix: #8061, don't crash if there is a network problem

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 86cc80348d
commit de404102c0

@ -170,10 +170,13 @@ function request(url, callback) {
require('request')(url, {
json: true,
}, function (err, res, body) {
if (err) {
return callback(err);
}
if (res.statusCode === 404 || !body) {
return callback(err, {});
return callback(null, {});
}
callback(err, body);
callback(null, body);
});
}
const requestAsync = util.promisify(request);

Loading…
Cancel
Save