code: def _export_work_errors(self, work, output_file):
      
      errors = set()
      for v in itervalues(work.work):
        if v['is_completed'] and v['error'] is not None:
          errors.add(v['error'])
      with open(output_file, 'w') as f:
        for e in sorted(errors):
          f.write(e)
          f.write('\n')
docs: Saves errors for given work pieces into file.
  
      Args:
        work: instance of either AttackWorkPieces or DefenseWorkPieces
        output_file: name of the output file