Skip to content

Commit

Permalink
fix(cli): ignore HTTP 429 errors
Browse files Browse the repository at this point in the history
This often happens with requests to GitHub
  • Loading branch information
sidvishnoi committed Nov 10, 2020
1 parent 1e0694a commit 198d214
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,16 @@ const enum ResultType {
}

function getResultType(result: Entry, options: OutputOptions) {
const { pageExists, fragExists, error } = result.output;
const { pageExists, fragExists, error, status } = result.output;

if (error) {
return ResultType.err;
}

if (status === 429 /** Too many requests */) {
return ResultType.err;
}

if (
(!pageExists && options.errorIf.has(result.type)) ||
(fragExists === false && options.errorIf.has("fragments"))
Expand Down

0 comments on commit 198d214

Please sign in to comment.