mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
fetch-yarn-deps: improve diagnostic messages
When the hash of an url being fetched does not match the expected value, this commit will cause fetch-yarn-deps to include the url in the error message to assist debugging.
This commit is contained in:
parent
84a75e9488
commit
9cac7a7475
@ -39,7 +39,7 @@ const downloadFileHttps = (fileName, url, expectedHash, hashType = 'sha1') => {
|
||||
const h = hash.read()
|
||||
if (expectedHash === undefined){
|
||||
console.log(`Warning: lockfile url ${url} doesn't end in "#<hash>" to validate against. Downloaded file had hash ${h}.`);
|
||||
} else if (h != expectedHash) return reject(new Error(`hash mismatch, expected ${expectedHash}, got ${h}`))
|
||||
} else if (h != expectedHash) return reject(new Error(`hash mismatch, expected ${expectedHash}, got ${h} for ${url}`))
|
||||
resolve()
|
||||
})
|
||||
res.on('error', e => reject(e))
|
||||
|
Loading…
Reference in New Issue
Block a user