input: Write a function to store and query user data in a JSON file. The function should be able to write user data to a JSON file and then read the data from that file. The user data is represented as a dictionary with keys "Name", "Age", and "City". If the JSON file does not exist, the function should handle the exception gracefully and return an empty dictionary.
  
  def store_user_data(data):
      try:
          with open('user_data.json', 'w') as f:
              json.dump(data, f)
      except Exception as e:
          print(f"An error occurred while storing data: {e}")
  
  def get_user_data():
      try:
          with open('user_data.json') as f:
              return json.load(f)
      except FileNotFoundError:
          return {}
      except Exception as e:
          print(f"An error occurred while retrieving data: {e}")
          return {}
  
  user_data = {"Name": "John", "Age": 25, "City": "New York"}
  
  # store data in JSON file
  store_user_data(user_data)
  
  # get data
  data = get_user_data()
  assert data == {"Name": "John", "Age": 25, "City": "New York"}
  
  user_data = {}
  store_user_data(user_data)
  data = get_user_data()
  assert data == {}
output: 
  def store_user_data(data):
      try:
          with open('user_data.json', 'w') as f:
              json.dump(data, f)
      except Exception as e:
          print(f"An error occurred while storing data: {e}")
  
  def get_user_data():
      try:
          with open('user_data.json') as f:
              return json.load(f)
      except FileNotFoundError:
          return {}
      except Exception as e:
          print(f"An error occurred while retrieving data: {e}")
          return {}
  