fix: abort repository when lockfile error

This commit is contained in:
Rhys Arkins 2018-05-24 16:28:36 +02:00
parent be4745dc6c
commit 2610015467
3 changed files with 7 additions and 1 deletions

View file

@ -202,7 +202,9 @@ async function processBranch(branchConfig, packageFiles) {
} }
if (err.message === 'lockfile-error') { if (err.message === 'lockfile-error') {
logger.info('Lock file error'); logger.info('Lock file error');
} else if (err.message !== 'registry-failure') { throw err;
}
if (err.message !== 'registry-failure') {
logger.error({ err }, `Error updating branch: ${err.message}`); logger.error({ err }, `Error updating branch: ${err.message}`);
} }
// Don't throw here - we don't want to stop the other renovations // Don't throw here - we don't want to stop the other renovations

View file

@ -55,6 +55,9 @@ async function handleError(config, err) {
logger.warn('Rate limit exceeded - aborting'); logger.warn('Rate limit exceeded - aborting');
delete config.branchList; // eslint-disable-line no-param-reassign delete config.branchList; // eslint-disable-line no-param-reassign
return err.message; return err.message;
} else if (err.message === 'lockfile-error') {
delete config.branchList; // eslint-disable-line no-param-reassign
return err.message;
} }
// Swallow this error so that other repositories can be processed // Swallow this error so that other repositories can be processed
logger.error( logger.error(

View file

@ -24,6 +24,7 @@ describe('workers/repository/error', () => {
'not-found', 'not-found',
'forbidden', 'forbidden',
'rate-limit-exceeded', 'rate-limit-exceeded',
'lockfile-error',
]; ];
errors.forEach(err => { errors.forEach(err => {
it(`errors ${err}`, async () => { it(`errors ${err}`, async () => {