Improve bad response error messages
A generic "Invalid parameters were given on search request" is given when the records requested exceed the 10,000 limit. For example the following request:
curl --location --request POST 'https://r3m15.preshiptesting.osdu.aws/api/search/v2/query' \
--header 'Content-Type: application/json' \
--header 'data-partition-id: osdu' \
--header 'Authorization: Bearer ...' \
--data-raw '{
"kind": "osdu:wks:master-data--Well:*",
"returnedFields": [
"id",
"kind",
"data.FacilityID",
"data.FacilityName",
"data.SpatialLocation.Wgs84Coordinates"
],
"sort": {
"field": [
"id"
],
"order": [
"ASC"
]
},
"limit": 1000,
"offset": 9001
}'
Response:
{ "code": 400, "reason": "Bad Request", "message": "Invalid parameters were given on search request" }
For this case it would be good to have a specific error message like "limit and offset parameters exceeds maximum limit".