def _length_checker(length: int, content: str) -> str:
    """Helper function to check if a string is shorter than expected length of not.

    Args:
        length: Maximum length of an expected string.
        content: A string to be validated.

    Returns:
        A string of error message if validation fails, or an empty string if validation succeeds.
    """
    if len(content) > length:
        return 'Invalid label: %s has %s characters. The maximum is %s.\n' % (
            content,
            len(content),
            length,
        )
    else:
        return ''