<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transfer_all(cls, field_mappings, sources, destination_factory=None):
 """Calls cls.transfer on all records in sources."""

    for index, source in enumerate(sources):
      try:
        yield cls.transfer(field_mappings, source, destination_factory or (lambda x: x))
      except Exception as ex:
        raise Exception("Error with source #{0}: {1}".format(index, ex)) from ex