Add better error handling for network interfaces