code: def get_error_summary(job):
      
      cache_key = 'error-summary-{}'.format(job.id)
      cached_error_summary = cache.get(cache_key)
      if cached_error_summary is not None:
          return cached_error_summary
  
      # don't cache or do anything if we have no text log errors to get
      # results for
      errors = TextLogError.objects.filter(step__job=job)
      if not errors:
          return []
  
      # cache terms generated from error line to save excessive querying
      term_cache = {}
  
      error_summary = [bug_suggestions_line(err, term_cache) for err in errors]
      cache.set(cache_key, error_summary, BUG_SUGGESTION_CACHE_TIMEOUT)
  
      return error_summary
docs: Create a list of bug suggestions for a job.
  
      Caches the results if there are any.