Skip to content

Commit

Permalink
fix(cache): handle 401
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Nov 9, 2021
1 parent d6dd27f commit 301678b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/workers/repository/cache.ts
Expand Up @@ -76,12 +76,10 @@ async function generateBranchCache(branch: BranchConfig): Promise<BranchCache> {
upgrades,
};
} catch (err) {
const errCodes = [401, 404];
// istanbul ignore if
if (err.response?.statusCode === 404) {
logger.warn(
{ err, branchName },
'404 error when generating branch cache'
);
if (errCodes.includes(err.response?.statusCode)) {
logger.warn({ err, branchName }, 'HTTP error generating branch cache');
return null;
}
logger.error({ err, branchName }, 'Error generating branch cache');
Expand Down

0 comments on commit 301678b

Please sign in to comment.