I have been reading alot of posts regarding this but non has come up with a solution. This issue is happening ingame and not studio.
I’ve read about this issue regarding ownership/teamcreate/studio. As far as I know none of them were relevant since this happens ingame. Studio access api is already turned on.
Roblox GetAsync is very inconsistent. Most of the times it returns, but sometimes it errors. The problem is that these errors are not any throttles. When trying to call GetAsync on a proper url, once it fails, it will always fail regardless of how many retries or waiting happens. I don’t have any problems with the calls failing but if there is no way to correctly fetch the info from url then there is no point in a errorhandling system.
Here is a snip of my code for fetching updated twitter codes. It includes handling the errors by retrying and waiting.
local url = --some url
function UpdatePasteBin()
local AvailablePasteBin = {}
local suc,err = pcall(function()
AvailablePasteBin = game:GetService("HttpService"):GetAsync(url) -- updates twittercodes
end)
if suc then
print(AvailablePasteBin) -- a dictionary containing the codes and rewards
local suc2,err2 = pcall(function()
TwitterCodes = game:GetService("HttpService"):JSONDecode(AvailablePasteBin)
end)
if suc2 then
return true
elseif not suc2 then
print('Error json twitter codes contact HAKU: ',err2)
return
end
else
warn("twitter fetch GetAsync error: ",err)
return
end
return
end
coroutine.wrap(function()
while true do
--- retry getasync 50 times ---
local returnvalue = UpdatePasteBin()
local retries = 0
if not returnvalue then
repeat
wait(5)
returnvalue = UpdatePasteBin()
retries=retries+1
until returnvalue == true or retries >= 50
end
--------------------------------
local timer = 60*10 -- 10 min between each update
for i = timer,0,-1 do
game.ReplicatedStorage.TwitterResetTimer.Timer.Value = timer
wait(1)
end
end
end)()
--------------------------------------
Thank you in advance.