improve pcap error handling