I'm currently trying to catch the location of a unit that died and this code: print("unit lost"); print(m_unitDeaths[PlayerID]); local pPlayer = Players[PlayerID]; local pUnit = pPlayer:GetUnits():FindID(unitID); -- unit is dead, so does not work? local UnitIndex = pUnit:GetUnitType(); print(UnitIndex); does not raise any error, but the last print is never executed. That means that, maybe because pUnit is nil, the function is aborted without any error message. This makes debugging very hard. So what to do, so I get an error or warning message for everytime sth like this happens?