Trap exceptions when printing packet.