def collect_errors_and_fail():
    """Pulls error traces from the error queue and fails if the queue is not empty."""
    failures = []
    for i in range(syn.test_errors.qsize()):
        failures.append(syn.test_errors.get())
    if len(failures) > 0:
        raise SynapseError('\n' + '\n'.join(failures))
    
######################
## Thread Behaviors ##    
######################
dataset/ETHPy150Open Sage-Bionetworks/synapsePythonClient/tests/integration/test_caching.py/collect_errors_and_fail/original