<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def raise_on_errors(errors, level=logging.CRITICAL):
 """Raise a CoTError if errors. Helper function because I had this code block everywhere. Args: errors (list):
 the error errors level (int, optional):
 the log level to use. Defaults to logging.CRITICAL Raises: CoTError: if errors is non-empty """

    if errors:
        log.log(level, "\n".join(errors))
        raise CoTError("\n".join(errors))