input: Write a function to determine if it is possible to create a HTML page that displays a table of contents from data stored in a database. If it is possible return 'Yes', otherwise return 'No'. If the database connection fails, return 'Error'.
  assert generate_table_of_contents(successful_db_connection)=='Yes'
  assert generate_table_of_contents(failed_db_connection)=='Error'
  assert generate_table_of_contents(lack_of_data)=='Yes'
output: def generate_table_of_contents(db_connection):
      try:
          if db_connection:
              return 'Yes'
          else:
              return 'Error'
      except:
          return 'Error'