In my game, the output is being flooded by this message, saying there was an internal error with UserHasBadgeAsync. I am using a script to check if the local player has a badge for my game with BadgeService:UserHasBadgeAsync, and if so it updates a GUI text label to show the player. Here is a picture of the script:
The error seems to be stopping my script, and it keeps happening over and over. The text doesn’t update during the game once you obtain the badge, and only when you rejoin the game it updates.
Expected behavior
If this issue wasn’t present, then the badge achieved text would update during the game, and it wouldn’t flood my output so I can see actually important messages.
Can you try again in a new server? Roblox has had a flurry of intermittent errors over the past few minutes but they seem to have resolved themselves now.
Like many other “Async” methods, UserHasBadgeAsync makes a web request. These can sometimes fail, so you should wrap them in pcall in case of potential errors.
local success, hasBadge = pcall(function()
return BadgeService:UserHasBadgeAsync(userId, badgeId)
end)
Still having the issue. It seems very inconsistent, for the past week or so, I have been experiencing the same issue and soon after it looks like it fixed itself, but then it happens again, over and over.
This behavior is not actually a bug unless you’re experiencing it 100% of the time for an extended period of time. These errors are expected every now and then and the documentation recommends you to wrap calls to this method in a pcall to adequately catch and handle said errors.