throwing lua error when connection is refused in luasocket