Unclear error message when using GetSortedAsync when minValue > maxValue

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:

  1. New file and publish it to a live place with Studio API access / live edit a place with Studio API access.
  2. Add a Script object to ServerScriptService.
  3. Set its contents to:
local ds = game:GetService("DataStoreService"):GetOrderedDataStore("_TEST")
ds:GetSortedAsync(true, 50, 10, 1) -- 10 > 1
  1. Press Play.
  2. 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.