diff --git a/server/utils/fetchNpmPackage.js b/server/utils/fetchNpmPackage.js index d485d20..561a00c 100644 --- a/server/utils/fetchNpmPackage.js +++ b/server/utils/fetchNpmPackage.js @@ -25,7 +25,8 @@ function fetchNpmPackage(packageConfig) { if (res.statusCode === 200) { resolve(res.pipe(gunzip()).pipe(tar.extract())); } else { - reject(res); + const spec = `${packageConfig.name}@${packageConfig.version}`; + reject(new Error(`Failed to fetch tarball for ${spec}`)); } }) .on("error", reject); diff --git a/server/utils/fetchNpmPackageInfo.js b/server/utils/fetchNpmPackageInfo.js index e2ff3ec..e7ce963 100644 --- a/server/utils/fetchNpmPackageInfo.js +++ b/server/utils/fetchNpmPackageInfo.js @@ -37,7 +37,7 @@ function fetchNpmPackageInfo(packageName) { if (res.statusCode === 200) { resolve(parseJSON(res)); } else { - reject(res); + reject(new Error(`Failed to fetch info for ${packageName}`)); } }) .on("error", reject);