wrap most of the risky code inside the packet handler in eval {...} to catch errors.