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

fix(github): handle 422 responses

parent 7fc12076
No related branches found
No related tags found
No related merge requests found
...@@ -146,6 +146,15 @@ async function get( ...@@ -146,6 +146,15 @@ async function get(
throw new Error('platform-failure'); throw new Error('platform-failure');
} }
throw new Error('bad-credentials'); throw new Error('bad-credentials');
} else if (err.statusCode === 422) {
if (
err.body &&
err.body.errors &&
err.body.errors.find((e: any) => e.code === 'invalid')
) {
throw new Error('repository-changed');
}
throw new Error('platform-failure');
} }
throw err; throw err;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment