fix: report package name if fetching fails

related to pnpm/pnpm#600
This commit is contained in:
Mina Nagy Zaki
2018-01-20 20:32:21 +02:00
committed by Zoltan Kochan
parent cce25e1608
commit 102c47f9fc

View File

@@ -491,7 +491,12 @@ async function fetcher (
if (!fetch) {
throw new Error(`Fetching for dependency type "${resolution.type}" is not supported`)
}
return await fetch(resolution, target, opts)
try {
return await fetch(resolution, target, opts)
} catch (err) {
logger.error(`Fetching ${opts.pkgId} failed!`)
throw err
}
}
async function getCacheByEngine (storePath: string, id: string): Promise<Map<string, string>> {