mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
eth/filters: return correct JSON-RPC error code for block range limit
Change error from fmt.Errorf to invalidParamsErr to return proper JSON-RPC error code (-32602 Invalid Params) instead of internal error code (-32603 Internal Error) when block range exceeds limit. Fixes #34646
This commit is contained in:
parent
d8cb8a962b
commit
44dfc9b4af
1 changed files with 1 additions and 1 deletions
|
|
@ -147,7 +147,7 @@ func (f *Filter) Logs(ctx context.Context) ([]*types.Log, error) {
|
|||
return nil, err
|
||||
}
|
||||
if f.rangeLimit != 0 && (end-begin) > f.rangeLimit {
|
||||
return nil, fmt.Errorf("exceed maximum block range: %d", f.rangeLimit)
|
||||
return nil, invalidParamsErr("exceed maximum block range: %d", f.rangeLimit)
|
||||
}
|
||||
return f.rangeLogs(ctx, begin, end)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue