Description:
When attempting to call GetSortedAsync on an OrderedDataStore, and you pass values for the minValue and maxValue parameters such that minValue > maxValue, the request errors with a generic internal error message rather than a specific error message indicating what happened.
Repro:
- New file and publish it to a live place with Studio API access / live edit a place with Studio API access.
- Add a Script object to ServerScriptService.
- Set its contents to:
local ds = game:GetService("DataStoreService"):GetOrderedDataStore("_TEST")
ds:GetSortedAsync(true, 50, 10, 1) -- 10 > 1
- Press Play.
- Observe Output.
Observed Behavior:
This error message appears:
502: API Services rejected request with error: ApiClient GamePersistenceApiClient exception:
Url = http://gamepersistence.api.roblox.com/v1/GetSortedValues
StatusCode = InternalServerError
StatusDescription = Internal Server Error
None of this describes what actually went wrong to the developer.
Desired Behavior:
A clear concise error message indicating that the error is that minValue > maxValue.
Preferably, when this is the case, no web request should be made but the API should immediately return with the error.