Catch socket errors too