Skip to content

eth/filters: use typed error for range limit exceeded#34674

Open
Kubudak90 wants to merge 1 commit intoethereum:masterfrom
Kubudak90:fix-range-limit-error
Open

eth/filters: use typed error for range limit exceeded#34674
Kubudak90 wants to merge 1 commit intoethereum:masterfrom
Kubudak90:fix-range-limit-error

Conversation

@Kubudak90
Copy link
Copy Markdown

Description

This PR fixes an inconsistency in error handling where was used instead of the typed error.

Problem

In , when the block range exceeds the configured limit, the code was returning:

However, the file defines a proper typed error that:

  1. Implements the interface with error code (invalid params)
  2. Can be properly detected using the helper function

Solution

Replace the call with the typed error:

Benefits

  • Proper JSON-RPC error code () is returned to API consumers
  • The function can now correctly detect this error
  • Consistent with the error handling pattern used elsewhere in the codebase

Testing

The change is minimal and maintains the same error message format. Existing tests for range limit handling should continue to pass.

Replace fmt.Errorf with errRangeLimitExceeded to ensure proper error
detection via IsRangeLimitExceeded function. The typed error implements
the rpc.Error interface with correct error code (-32602).

Fixes ethereum#1234
@Kubudak90 Kubudak90 requested a review from rjl493456442 as a code owner April 7, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant