input: Write a function to modify the provided Python code to handle errors. The function should attempt to read data from a JSON file, and if any errors occur, it should print an appropriate message. If no errors occur, it should return the data read from the JSON file. The function should handle FileNotFoundError and json.decoder.JSONDecodeError.
  
  ### Function:
  def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          print("The file specified does not exist.")
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")
  
  ### Test Cases:
  assert read_data_from_json("existing_file.json")=={'key': 'value'}
  assert read_data_from_json("nonexistent_file.json")=="The file specified does not exist."
  assert read_data_from_json("invalid_json_file.json")=="The file specified is not in a valid JSON format."
output: def read_data_from_json(filename):
      try:
          with open(filename, 'r') as f:
              data = json.load(f)
          return data
      except FileNotFoundError:
          print("The file specified does not exist.")
      except json.decoder.JSONDecodeError:
          print("The file specified is not in a valid JSON format.")