Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix access to headers in error cause
Browse files Browse the repository at this point in the history
  • Loading branch information
RonaldEAM committed Apr 17, 2024
1 parent fdc0d64 commit c79a992
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export class APIClient extends BaseAPIClient {
) {
const headers = err.cause.headers;
retryAfter = this.getDelayUntilReset(
headers.get('date') as string,
headers.get('x-rate-limit-reset') as string,
headers['date'] as string,
headers['x-rate-limit-reset'] as string,
);
}

Expand Down Expand Up @@ -440,8 +440,8 @@ export class APIClient extends BaseAPIClient {
) {
const headers = err.cause.headers;
retryAfter = this.getDelayUntilReset(
headers.get('date') as string,
headers.get('x-rate-limit-reset') as string,
headers['date'] as string,
headers['x-rate-limit-reset'] as string,
);
}

Expand Down

0 comments on commit c79a992

Please sign in to comment.