How to detect if GetItemDetails() errors?

If you put a deleted item id in “GetItemDetails()” this error shows:

HTTP 404 (Not Found)

So i tried to use if statment to detect if its error

local BackId = Desc.BackAccessory -- i get the id from a HumanoidDescription and in this case it's "131510467732490"
if not Avatar:GetItemDetails(BackId, Enum.AvatarItemType.Asset, {}) then
	print(BackId.." is unavailable")
end

but this does not work
here is the output

can anyone help?

i have alot of scripts that depends in the ids in the HumanoidDescription
and if the id is for unavailable item thay will malfunction
so i want to detect if its and remove it before these scripts even run

Use pcall to yield incase of errors or failure,

local BackId = Desc.BackAccessory
local success, bool = pcall(function()
  return Avatar:GetItemDetails(BackId, Enum.AvatarItemType.Asset, {})
end)
if success then
   print(BackId, bool)
end

yeah
i did:

local success, bool = pcall(function()
	return Avatar:GetItemDetails(BackId, Enum.AvatarItemType.Asset, {})
end)
if not success then
	BackId = " "
end