Common error checking code for Rage classes