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