input: Write a function to scrape the latest stock prices from Yahoo Finance. The function should take a list of stock names as input and return a list of prices corresponding to each stock. If an error occurs during the process, the function should return a message indicating the stock that caused the error and the error type. The function should use the `requests` and `BeautifulSoup` libraries for scraping.
  
  assert get_stock_price(["AAPL stocks", "MSFT stocks", "FB stocks"])==["142.65", "264.59", "323.45"]
  assert get_stock_price(["GOOG stocks"])==["1023.50"]
  assert get_stock_price(["AMZN stocks"])==["Message: AMZN stocks caused a ConnectionError"]
  assert get_stock_price([])==[]
output: def get_stock_price(stock_names):
      if not stock_names:
          return []
      prices = []
      for stock in stock_names:
          try:
              url = f"https://finance.yahoo.com/quote/{stock}"
              response = requests.get(url)
              response.raise_for_status()
              soup = BeautifulSoup(response.text, 'html.parser')
              price = soup.find('fin-streamer', {'data-field': 'regularMarketPrice'}).text
              prices.append(price)
          except Exception as e:
              prices.append(f"Message: {stock} caused a {type(e).__name__}")
      return prices