diff --git a/pkg/services/rpcsrv/server.go b/pkg/services/rpcsrv/server.go index 9c588c3de..153458cc7 100644 --- a/pkg/services/rpcsrv/server.go +++ b/pkg/services/rpcsrv/server.go @@ -2487,7 +2487,7 @@ func (s *Server) traverseIterator(reqParams params.Params) (any, *neorpc.Error) return nil, neorpc.NewInvalidParamsError("invalid iterator items count: not an int32") } if count > s.config.MaxIteratorResultItems { - return nil, neorpc.NewInvalidParamsError(fmt.Sprintf("iterator items count is out of range (%d at max)", s.config.MaxIteratorResultItems)) + return nil, neorpc.NewInvalidParamsError(fmt.Sprintf("iterator items count (%d) is out of range (%d at max)", count, s.config.MaxIteratorResultItems)) } s.sessionsLock.Lock() diff --git a/pkg/services/rpcsrv/server_test.go b/pkg/services/rpcsrv/server_test.go index 81c542e5c..6fb1222f4 100644 --- a/pkg/services/rpcsrv/server_test.go +++ b/pkg/services/rpcsrv/server_test.go @@ -2975,7 +2975,7 @@ func testRPCProtocol(t *testing.T, doRPCCall func(string, string, *testing.T) [] sID, iID := prepareIteratorSession(t) rpc := fmt.Sprintf(`{"jsonrpc": "2.0", "id": 1, "method": "traverseiterator", "params": ["%s", "%s", %d]}"`, sID.String(), iID.String(), config.DefaultMaxIteratorResultItems+1) body := doRPCCall(rpc, httpSrv.URL, t) - checkErrGetResult(t, body, true, neorpc.InvalidParamsCode, fmt.Sprintf("iterator items count is out of range (%d at max)", config.DefaultMaxIteratorResultItems)) + checkErrGetResult(t, body, true, neorpc.InvalidParamsCode, fmt.Sprintf("iterator items count (%d) is out of range (%d at max)", config.DefaultMaxIteratorResultItems+1, config.DefaultMaxIteratorResultItems)) }) t.Run("unknown session", func(t *testing.T) { _, iID := prepareIteratorSession(t)