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

fix(gitFs): gracefully handle authentication failure

parent 2b122345
No related branches found
No related tags found
No related merge requests found
...@@ -331,6 +331,11 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) { ...@@ -331,6 +331,11 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) {
return 'error'; return 'error';
} else if (err.message === 'bundler-unknown') { } else if (err.message === 'bundler-unknown') {
logger.warn('Unknown bundler error'); logger.warn('Unknown bundler error');
} else if (
err.messagee &&
err.message.includes('fatal: Authentication failed')
) {
throw new Error('authentication-failure');
} else if ( } else if (
err.message !== 'registry-failure' && err.message !== 'registry-failure' &&
err.message !== 'platform-failure' err.message !== 'platform-failure'
......
...@@ -99,6 +99,11 @@ async function handleError(config, err) { ...@@ -99,6 +99,11 @@ async function handleError(config, err) {
delete config.branchList; // eslint-disable-line no-param-reassign delete config.branchList; // eslint-disable-line no-param-reassign
return err.message; return err.message;
} }
if (err.message === 'authentication-error') {
logger.warn('Authentication error - aborting');
delete config.branchList; // eslint-disable-line no-param-reassign
return err.message;
}
if (err.message === 'lockfile-error') { if (err.message === 'lockfile-error') {
delete config.branchList; // eslint-disable-line no-param-reassign delete config.branchList; // eslint-disable-line no-param-reassign
logger.info('Lock file error - aborting'); logger.info('Lock file error - aborting');
......
...@@ -31,6 +31,7 @@ describe('workers/repository/error', () => { ...@@ -31,6 +31,7 @@ describe('workers/repository/error', () => {
'no-vulnerability-alerts', 'no-vulnerability-alerts',
'cannot-fork', 'cannot-fork',
'integration-unauthorized', 'integration-unauthorized',
'authentication-error',
]; ];
errors.forEach(err => { errors.forEach(err => {
it(`errors ${err}`, async () => { it(`errors ${err}`, async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment