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

fix(git): gracefully abort for bad revision errors

parent 8b0cac5a
No related branches found
No related tags found
No related merge requests found
...@@ -544,6 +544,9 @@ export async function processBranch( ...@@ -544,6 +544,9 @@ export async function processBranch(
err.message.includes('fatal: Authentication failed') err.message.includes('fatal: Authentication failed')
) { ) {
throw new Error(PLATFORM_AUTHENTICATION_ERROR); throw new Error(PLATFORM_AUTHENTICATION_ERROR);
} else if (err.message?.includes('fatal: bad revision')) {
logger.debug({ err }, 'Aborting job due to bad revision error');
throw new Error(REPOSITORY_CHANGED);
} else if (!(err instanceof ExternalHostError)) { } else if (!(err instanceof ExternalHostError)) {
logger.error({ err }, `Error updating branch: ${String(err.message)}`); logger.error({ err }, `Error updating branch: ${String(err.message)}`);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment