Skip to content
Snippets Groups Projects
Commit ed0bb876 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(yarn): throw errors when registry down

Detect strings in `yarn` `stderr` that indicate a registry problem and if found then throw a `registry-failure` error instead of continuing with a PR creation or update. This way they should be retried on each run until the registry is available again.

Closes #2474, Closes #2475
parent 31a1c116
No related branches found
No related tags found
No related merge requests found
......@@ -87,9 +87,18 @@ async function generateLockFile(tmpDir, env) {
},
'lock file error'
);
if (err.stderr && err.stderr.includes('ENOSPC: no space left on device')) {
if (err.stderr) {
if (err.stderr.includes('ENOSPC: no space left on device')) {
throw new Error('Out of disk space when generating yarn.lock');
}
if (
err.stderr.includes('The registry may be down.') ||
err.stderr.includes('getaddrinfo ENOTFOUND registry.yarnpkg.com') ||
err.stderr.includes('getaddrinfo ENOTFOUND registry.npmjs.org')
) {
throw new Error('registry-failure');
}
}
return { error: true, stderr: err.stderr };
}
return { lockFile };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment