Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handle rate limit, update missed nest dependency #25

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Update @nestjs/event-emitter to compatible version with other nest dependencies (#25)

### Fixed
- Rate limit errors not correctly being detected (#25)

## [5.8.0] - 2025-02-27
### Changed
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@nestjs/common": "^11.0.10",
"@nestjs/core": "^11.0.10",
"@nestjs/event-emitter": "^2.0.0",
"@nestjs/event-emitter": "^3.0.1",
"@nestjs/platform-express": "^11.0.10",
"@nestjs/schedule": "^5.0.1",
"@subql/common": "^5.4.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/node/src/starknet/api.connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ export class StarknetApiConnection
formatted_error = new TimeoutError(e);
} else if (e.message.startsWith(`disconnected from `)) {
formatted_error = new DisconnectionError(e);
} else if (e.message.startsWith(`Rate Limited at endpoint`)) {
} else if (
e.message.startsWith(`Rate Limited at endpoint`) ||
e.message.includes('Rate limit reached')
) {
formatted_error = new RateLimitError(e);
} else if (e.message.includes(`Exceeded max limit of`)) {
formatted_error = new LargeResponseError(e);
Expand Down
17 changes: 2 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2328,20 +2328,7 @@ __metadata:
languageName: node
linkType: hard

"@nestjs/event-emitter@npm:^2.0.0":
version: 2.0.0
resolution: "@nestjs/event-emitter@npm:2.0.0"
dependencies:
eventemitter2: 6.4.9
peerDependencies:
"@nestjs/common": ^8.0.0 || ^9.0.0 || ^10.0.0
"@nestjs/core": ^8.0.0 || ^9.0.0 || ^10.0.0
reflect-metadata: ^0.1.12
checksum: 958eec68b5a157fd81d00e53ee90de6b01a981968befd6d4b13c056faba0a55bde3cf9a820da333031c320c0d752d7488540a4b7e8cf8ea07bb95be30a670235
languageName: node
linkType: hard

"@nestjs/event-emitter@npm:^3.0.0":
"@nestjs/event-emitter@npm:^3.0.0, @nestjs/event-emitter@npm:^3.0.1":
version: 3.0.1
resolution: "@nestjs/event-emitter@npm:3.0.1"
dependencies:
Expand Down Expand Up @@ -2973,7 +2960,7 @@ __metadata:
dependencies:
"@nestjs/common": ^11.0.10
"@nestjs/core": ^11.0.10
"@nestjs/event-emitter": ^2.0.0
"@nestjs/event-emitter": ^3.0.1
"@nestjs/platform-express": ^11.0.10
"@nestjs/schedule": ^5.0.1
"@nestjs/schematics": ^11.0.1
Expand Down
Loading