diff --git a/packages/node/CHANGELOG.md b/packages/node/CHANGELOG.md index a8c4998c..b9fcd379 100644 --- a/packages/node/CHANGELOG.md +++ b/packages/node/CHANGELOG.md @@ -5,6 +5,8 @@ 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] +### Fixed +- 429 rate limit error handling ## [3.0.1] - 2023-10-12 ### Changed diff --git a/packages/node/src/algorand/api.connection.ts b/packages/node/src/algorand/api.connection.ts index 932da986..eeee8442 100644 --- a/packages/node/src/algorand/api.connection.ts +++ b/packages/node/src/algorand/api.connection.ts @@ -69,7 +69,10 @@ export class AlgorandApiConnection formatted_error = AlgorandApiConnection.handleTimeoutError(e); } else if (e.message.startsWith(`disconnected from `)) { formatted_error = AlgorandApiConnection.handleDisconnectionError(e); - } else if (e.message.startsWith(`Rate Limited at endpoint`)) { + } else if ( + e.message.startsWith(`Rate Limited at endpoint`) || + (e as any).statusCode === 429 + ) { formatted_error = AlgorandApiConnection.handleRateLimitError(e); } else if (e.message.includes(`Exceeded max limit of`)) { formatted_error = AlgorandApiConnection.handleLargeResponseError(e);