def exit_if_errors(metadata):
    """Determine if CellMetadata.issues has errors
    Exit with error code 1 if errors are reported, return False if no errors
    """
    errors = False
    for error_type in metadata.issues.keys():
        for error_category, category_dict in metadata.issues[error_type].items():
            if category_dict:
                if error_type == "error":
                    errors = True
    if errors:
        exit(1)
    return errors