Skip to content

Commit

Permalink
fix: check of rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcastrodev committed Sep 30, 2023
1 parent e216e67 commit ec62963
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Services/GithubApiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ export class GithubApiService extends GithubRepository {

private handleError(responseErrors: GithubError[]): ServiceError {
const errors = responseErrors ?? [];
const isRateLimitExceeded = (errors ?? []).some((error) => {
error.type.includes(EServiceKindError.RATE_LIMIT);
});
const isRateLimitExceeded = errors.some((error) =>
error.type.includes(EServiceKindError.RATE_LIMIT) ||
error.message.includes("rate limit")
);

if (isRateLimitExceeded) {
throw new ServiceError(
Expand Down

0 comments on commit ec62963

Please sign in to comment.