After looking at the docs, I understand the confusion, I believe this is as designed though, if the server would handle the error, the client would hang (yield) forever. Instead the server returns with the error to the Client where the error is displayed.
You can wrap your Http call in a pcall (as is often recommended with functions that can throw) and handle the error on the server side or log the error on the server side and rethrow so the client(s) also know about it.
I understand. However, httperrors are not the only errors that can happen. Often there are simply errors in the script. My game uses a lot of remote functions, slowing down development due to more complicated debugging. I don’t think using pcalls everywhere is the ultimate solution, but rather passing the source of the error to the client. Could you pass this on to feature requests?
Thank you very much!
The recommendation for this is to use RemoteEvents – you can still send arguments with the remote events, however because they are async, there is no risk of infinite yield:
Your code would result in a server error changed to:
Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:FindFirstChildOfClass("RemoteEvent")
remoteEvent.OnServerEvent:Connect(function()
game.MarketplaceService:GetProductInfo(1)
end)
LocalScript:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteEvent = ReplicatedStorage:FindFirstChildOfClass("RemoteEvent")
remoteEvent:FireServer()
Error:
09:52:02.172 error.rbxl auto-recovery file was created - Studio
09:52:04.353 MarketplaceService:getProductInfo() failed because HTTP 400 (Bad Request) - Server - Script:5
09:52:04.353 Stack Begin - Studio
09:52:04.353 Script 'ServerScriptService.Script', Line 5 - Studio - Script:5
09:52:04.353 Stack End - Studio