Return null for 404s
This commit is contained in:
parent
c464dc3c3e
commit
6075deb73f
|
@ -36,6 +36,8 @@ function fetchNpmPackageInfo(packageName) {
|
|||
.get(options, res => {
|
||||
if (res.statusCode === 200) {
|
||||
resolve(parseJSON(res));
|
||||
} else if (res.statusCode === 404) {
|
||||
resolve(null);
|
||||
} else {
|
||||
bufferStream(res).then(data => {
|
||||
const content = data.toString("utf-8");
|
||||
|
|
Loading…
Reference in New Issue