Trap and report socket errors when parsing IP addresses