input: Write a function to list the contents of a directory using Python. The function should return a list containing the names of all items in the directory. The function should handle any errors that may occur while accessing the directory.
  assert list_directory_contents()==['file1.txt', 'file2.txt', 'folder']
  assert list_directory_contents()=="Error accessing directory."
output: import os
  
  def list_directory_contents():
      try:
          return os.listdir('.')
      except OSError:
          return "Error accessing directory."