From ec62963435350779b65b3d8e0417b65cffaca193 Mon Sep 17 00:00:00 2001 From: Alex Oliveira Date: Sat, 30 Sep 2023 10:07:49 +0100 Subject: [PATCH] fix: check of rate limit --- src/Services/GithubApiService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Services/GithubApiService.ts b/src/Services/GithubApiService.ts index 685bac58..c8c885c9 100644 --- a/src/Services/GithubApiService.ts +++ b/src/Services/GithubApiService.ts @@ -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(