User story
As a developer, I currently have to go out of my way to track down when I use PlayerHasPass with a gamepass Id <= 0.
What is the problem?
When GamePassService:PlayerHasPass(player, gamepassId) is supplied a gamepass Id <=0, it returns false and produces the following red text “error” which does not break out of the script:
16:53:19.794 - Internal error while fetching asset type because MarketplaceService:GetProductInfo() argument is not a valid assetId (supplied assetId was less than 0)
Repro: Run the following in the command line in Play Solo:
print(game:GetService("GamePassService"):PlayerHasPass(game.Players:GetPlayers()[1], 0))
Why is this a problem?
- The error is misleading as it specifies GetProductInfo even though the source is PlayerHasPass
- The error is misleading as it specifies the ID is less than 0 when it is inclusive to 0
- The error message does not provide a stack trace
- This is not a true error (doesn’t break the script), so the script has no idea the value was incorrect
Result of resolving problem
If ROBLOX addresses this problem, my development experience would improve in the following ways:
- I would not be confused as to what the cause of the error is
- I would be able to locate the source of the error easily and rectify it quickly
- Scripts would break instead of silently failing, alerting me to the cause